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 LNN_SETTINGDATA_EVENT_MONITOR_DEPS_MOCK_H 17 #define LNN_SETTINGDATA_EVENT_MONITOR_DEPS_MOCK_H 18 19 #include <gmock/gmock.h> 20 #include <securec.h> 21 22 #include "lnn_async_callback_utils.h" 23 #include "message_handler.h" 24 #include "softbus_utils.h" 25 26 namespace OHOS { 27 class SettingDataEventMonitorDepsInterface { 28 public: SettingDataEventMonitorDepsInterface()29 SettingDataEventMonitorDepsInterface() {}; ~SettingDataEventMonitorDepsInterface()30 virtual ~SettingDataEventMonitorDepsInterface() {}; 31 32 virtual SoftBusLooper *GetLooper(int32_t looper) = 0; 33 virtual int32_t LnnAsyncCallbackHelper(SoftBusLooper *looper, LnnAsyncCallbackFunc callback, void *para) = 0; 34 virtual int32_t GetActiveOsAccountIds(void) = 0; 35 }; 36 37 class SettingDataEventMonitorDepsInterfaceMock : public SettingDataEventMonitorDepsInterface { 38 public: 39 SettingDataEventMonitorDepsInterfaceMock(); 40 ~SettingDataEventMonitorDepsInterfaceMock() override; 41 42 MOCK_METHOD1(GetLooper, SoftBusLooper * (int)); 43 MOCK_METHOD3(LnnAsyncCallbackHelper, int32_t (SoftBusLooper *, LnnAsyncCallbackFunc, void *)); 44 MOCK_METHOD0(GetActiveOsAccountIds, int32_t (void)); 45 }; 46 } // namespace OHOS 47 #endif // LNN_SETTINGDATA_EVENT_MONITOR_DEPS_MOCK_H 48