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_METHOD3(GetRemoteCopyInfo, int32_t(const std::string &srcUri, bool &isFile, bool &isDir)); 44 45 MOCK_METHOD3(PushAsset, 46 int32_t(int32_t userId, 47 const sptr<AssetObj> &assetObj, 48 const sptr<IAssetSendCallback> &sendCallback)); 49 MOCK_METHOD1(RegisterAssetCallback, int32_t(const sptr<IAssetRecvCallback> &recvCallback)); 50 MOCK_METHOD1(UnRegisterAssetCallback, int32_t(const sptr<IAssetRecvCallback> &recvCallback)); 51 }; 52 } // namespace DistributedFile 53 } // namespace Storage 54 } // namespace OHOS 55 #endif // FILEMANAGEMENT_DFS_SERVICE_DAEMON_MOCK_H 56