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 #ifndef OHOS_UTTest_SOFTBUS_LISTENER_H 16 #define OHOS_UTTest_SOFTBUS_LISTENER_H 17 18 #include <gtest/gtest.h> 19 #include <refbase.h> 20 #include <map> 21 #include <memory> 22 #include <mutex> 23 #include <string> 24 #include <vector> 25 26 #include "softbus_adapter.h" 27 #include "softbus_bus_center.h" 28 #include "softbus_listener.h" 29 #include "dm_device_info.h" 30 #include "dm_subscribe_info.h" 31 #include "inner_session.h" 32 #include "session.h" 33 34 namespace OHOS { 35 namespace DistributedHardware { 36 class SoftbusListenerTest : public testing::Test { 37 public: 38 static void SetUpTestCase(); 39 static void TearDownTestCase(); 40 void SetUp(); 41 void TearDown(); 42 }; 43 44 class ISoftbusDiscoveringCallbackTest : public ISoftbusDiscoveringCallback { 45 public: ~ISoftbusDiscoveringCallbackTest()46 virtual ~ISoftbusDiscoveringCallbackTest() 47 { 48 } OnDeviceFound(const std::string & pkgName,const DmDeviceInfo & info,bool isOnline)49 void OnDeviceFound(const std::string &pkgName, const DmDeviceInfo &info, bool isOnline) override 50 { 51 (void)pkgName; 52 (void)info; 53 (void)isOnline; 54 } OnDiscoveringResult(const std::string & pkgName,int32_t subscribeId,int32_t result)55 void OnDiscoveringResult(const std::string &pkgName, int32_t subscribeId, int32_t result) override 56 { 57 (void)pkgName; 58 (void)subscribeId; 59 (void)result; 60 } 61 }; 62 } // namespace DistributedHardware 63 } // namespace OHOS 64 #endif 65