• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 , (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef MOCK_SERVICE_REVERSE_PROXY_MOCK_H
17 #define MOCK_SERVICE_REVERSE_PROXY_MOCK_H
18 
19 #include <gmock/gmock.h>
20 
21 #include "i_service_reverse.h"
22 #include "iremote_proxy.h"
23 
24 namespace OHOS::FileManagement::Backup {
25 class ServiceReverseProxyMock : public IRemoteProxy<IServiceReverse> {
26 public:
27     MOCK_METHOD(int, SendRequest, (uint32_t, MessageParcel&, MessageParcel&, MessageOption&));
28     MOCK_METHOD(void, BackupOnFileReady, (std::string, std::string, int, int32_t));
29     MOCK_METHOD(void, BackupOnBundleStarted, (int32_t, std::string));
30     MOCK_METHOD(void, BackupOnResultReport, (std::string, std::string));;
31     MOCK_METHOD(void, BackupOnBundleFinished, (int32_t, std::string));
32     MOCK_METHOD(void, BackupOnAllBundlesFinished, (int32_t));
33     MOCK_METHOD(void, BackupOnProcessInfo, (std::string, std::string));
34     MOCK_METHOD(void, BackupOnScanningInfo, (std::string));
35 
36     MOCK_METHOD(void, RestoreOnBundleStarted, (int32_t, std::string));
37     MOCK_METHOD(void, RestoreOnBundleFinished, (int32_t, std::string));
38     MOCK_METHOD(void, RestoreOnAllBundlesFinished, (int32_t));
39     MOCK_METHOD(void, RestoreOnFileReady, (std::string, std::string, int, int32_t));
40     MOCK_METHOD(void, RestoreOnResultReport, (std::string, std::string, ErrCode));
41     MOCK_METHOD(void, RestoreOnProcessInfo, (std::string, std::string));
42 
43     MOCK_METHOD(void, IncrementalBackupOnFileReady, (std::string, std::string, int, int, int32_t));
44     MOCK_METHOD(void, IncrementalBackupOnBundleStarted, (int32_t, std::string));
45     MOCK_METHOD(void, IncrementalBackupOnResultReport, (std::string, std::string));
46     MOCK_METHOD(void, IncrementalBackupOnBundleFinished, (int32_t, std::string));
47     MOCK_METHOD(void, IncrementalBackupOnAllBundlesFinished, (int32_t));
48     MOCK_METHOD(void, IncrementalBackupOnProcessInfo, (std::string, std::string));
49     MOCK_METHOD(void, IncrementalBackupOnScanningInfo, (std::string));
50 
51     MOCK_METHOD(void, IncrementalRestoreOnBundleStarted, (int32_t, std::string));
52     MOCK_METHOD(void, IncrementalRestoreOnBundleFinished, (int32_t, std::string));
53     MOCK_METHOD(void, IncrementalRestoreOnAllBundlesFinished, (int32_t));
54     MOCK_METHOD(void, IncrementalRestoreOnFileReady, (std::string, std::string, int, int, int32_t));
55     MOCK_METHOD(void, IncrementalRestoreOnResultReport, (std::string, std::string, ErrCode));;
56     MOCK_METHOD(void, IncrementalRestoreOnProcessInfo, (std::string, std::string));
57 
58 public:
ServiceReverseProxyMock()59     ServiceReverseProxyMock() : IRemoteProxy<IServiceReverse>(nullptr) {}
60     virtual ~ServiceReverseProxyMock() = default;
61 };
62 } // namespace OHOS::FileManagement::Backup
63 #endif // MOCK_SERVICE_REVERSE_PROXY_MOCK_H