1 /* 2 * Copyright (c) 2025 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 BR_PROXY_TEST_MOCK_H 17 #define BR_PROXY_TEST_MOCK_H 18 19 #include <gmock/gmock.h> 20 #include "trans_client_proxy.h" 21 #include "br_proxy.h" 22 23 namespace OHOS { 24 class BrProxyInterface { 25 public: BrProxyInterface()26 BrProxyInterface() {}; ~BrProxyInterface()27 virtual ~BrProxyInterface() {}; 28 virtual int32_t ClientIpcBrProxyOpened(const char *pkgName, int32_t channelId, 29 const char *brMac, const char *uuid, int32_t reason) = 0; 30 virtual int32_t ConnectPeerDevice(BrProxyChannelInfo *channelInfo, uint32_t *requestId) = 0; 31 virtual int32_t GetCallerHapInfo(char *bundleName, uint32_t bundleNamelen, 32 char *abilityName, uint32_t abilityNameLen) = 0; 33 }; 34 35 class BrProxyInterfaceMock : public BrProxyInterface { 36 public: 37 BrProxyInterfaceMock(); 38 ~BrProxyInterfaceMock() override; 39 MOCK_METHOD5(ClientIpcBrProxyOpened, int32_t (const char *pkgName, int32_t channelId, 40 const char *brMac, const char *uuid, int32_t reason)); 41 MOCK_METHOD2(ConnectPeerDevice, int32_t (BrProxyChannelInfo *channelInfo, uint32_t *requestId)); 42 MOCK_METHOD4(GetCallerHapInfo, int32_t (char *bundleName, uint32_t bundleNamelen, 43 char *abilityName, uint32_t abilityNameLen)); 44 }; 45 } // namespace OHOS 46 #endif // BR_PROXY_TEST_MOCK_H