• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024-2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License") = 0;
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 OHOS_FILEMGMT_BACKUP_SVC_BACKUP_CONNECTION_MOCK_H
17 #define OHOS_FILEMGMT_BACKUP_SVC_BACKUP_CONNECTION_MOCK_H
18 
19 #include <gmock/gmock.h>
20 
21 #include <iremote_proxy.h>
22 #include "iextension.h"
23 
24 namespace OHOS::FileManagement::Backup {
25 class SvcExtensionProxyMock : public IRemoteProxy<IExtension> {
26 public:
SvcExtensionProxyMock()27     SvcExtensionProxyMock() : IRemoteProxy<IExtension>(nullptr) {};
28     virtual ~SvcExtensionProxyMock() = default;
29 public:
30 MOCK_METHOD(ErrCode, GetFileHandleWithUniqueFd, (const std::string &, int32_t &, int32_t &));
31 MOCK_METHOD(ErrCode, HandleClear, ());
32 MOCK_METHOD(ErrCode, HandleBackup, (bool));
33 MOCK_METHOD(ErrCode, PublishFile, (const std::string &));
34 MOCK_METHOD(ErrCode, HandleRestore, (bool));
35 MOCK_METHOD(ErrCode, GetIncrementalFileHandle, (const std::string &, int &, int &, int32_t &));
36 MOCK_METHOD(ErrCode, PublishIncrementalFile, (const std::string &));
37 MOCK_METHOD(ErrCode, HandleIncrementalBackup, (int32_t, int32_t));
38 MOCK_METHOD(ErrCode, IncrementalOnBackup, (bool));
39 MOCK_METHOD(ErrCode, GetIncrementalBackupFileHandle, (int &, int &));
40 MOCK_METHOD(ErrCode, GetBackupInfo, (std::string &));
41 MOCK_METHOD(ErrCode, UpdateFdSendRate, (const std::string &, int32_t));
42 MOCK_METHOD(ErrCode, User0OnBackup, ());
43 MOCK_METHOD(ErrCode, UpdateDfxInfo, (int64_t, uint32_t, const std::string &));
44 MOCK_METHOD(ErrCode, CleanBundleTempDir, ());
45 MOCK_METHOD(ErrCode, HandleOnRelease, (int32_t));
46 MOCK_METHOD(ErrCode, HandleGetCompatibilityInfo, (const std::string &, int32_t, std::string &));
47 };
48 } // namespace OHOS::FileManagement::Backup
49 #endif // OHOS_FILEMGMT_BACKUP_SVC_BACKUP_CONNECTION_MOCK_H