• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Copyright (c) 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 FILEMANAGEMENT_DFS_SERVICE_DAEMON_MOCK_H
17 #define FILEMANAGEMENT_DFS_SERVICE_DAEMON_MOCK_H
18 
19 #include <gmock/gmock.h>
20 #include "daemon.h"
21 
22 namespace OHOS {
23 namespace Storage {
24 namespace DistributedFile {
25 class DaemonMock : public DaemonStub {
26 public:
27     MOCK_METHOD1(OpenP2PConnection, int32_t(const DistributedHardware::DmDeviceInfo &deviceInfo));
28     MOCK_METHOD1(CloseP2PConnection, int32_t(const DistributedHardware::DmDeviceInfo &deviceInfo));
29     MOCK_METHOD2(OpenP2PConnectionEx, int32_t(const std::string &networkId, sptr<IFileDfsListener> remoteReverseObj));
30     MOCK_METHOD1(CloseP2PConnectionEx, int32_t(const std::string &networkId));
31     MOCK_METHOD4(RequestSendFile,
32                  int32_t(const std::string &srcUri,
33                          const std::string &dstPath,
34                          const std::string &remoteDeviceId,
35                          const std::string &sessionName));
36     MOCK_METHOD5(PrepareSession,
37                  int32_t(const std::string &srcUri,
38                          const std::string &dstUri,
39                          const std::string &srcDeviceId,
40                          const sptr<IRemoteObject> &listener,
41                          HmdfsInfo &fileInfo));
42     MOCK_METHOD1(CancelCopyTask, int32_t(const std::string &sessionName));
43     MOCK_METHOD2(CancelCopyTask, int32_t(const std::string &srcUri, const std::string &dstUri));
44     MOCK_METHOD3(GetRemoteCopyInfo, int32_t(const std::string &srcUri, bool &isFile, bool &isDir));
45 
46     MOCK_METHOD3(PushAsset,
47                  int32_t(int32_t userId,
48                          const sptr<AssetObj> &assetObj,
49                          const sptr<IAssetSendCallback> &sendCallback));
50     MOCK_METHOD1(RegisterAssetCallback, int32_t(const sptr<IAssetRecvCallback> &recvCallback));
51     MOCK_METHOD1(UnRegisterAssetCallback, int32_t(const sptr<IAssetRecvCallback> &recvCallback));
52     MOCK_METHOD3(GetDfsUrisDirFromLocal, int32_t(const std::vector<std::string> &uriList,
53                                                  const int32_t userId,
54                                                  std::unordered_map<std::string,
55                                                  AppFileService::ModuleRemoteFileShare::HmdfsUriInfo>
56                                                  &uriToDfsUriMaps));
57     MOCK_METHOD2(GetDfsSwitchStatus, int32_t(const std::string &networkId, int32_t &switchStatus));
58     MOCK_METHOD1(UpdateDfsSwitchStatus, int32_t(int32_t switchStatus));
59     MOCK_METHOD1(GetConnectedDeviceList, int32_t(std::vector<DfsDeviceInfo> &deviceList));
60 };
61 } // namespace DistributedFile
62 } // namespace Storage
63 } // namespace OHOS
64 #endif // FILEMANAGEMENT_DFS_SERVICE_DAEMON_MOCK_H
65