1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef MOCK_WIFI_LEGACY_HAL_H_ 18 #define MOCK_WIFI_LEGACY_HAL_H_ 19 20 #include <gmock/gmock.h> 21 22 #include "wifi_legacy_hal.h" 23 24 namespace android { 25 namespace hardware { 26 namespace wifi { 27 namespace V1_4 { 28 namespace implementation { 29 namespace legacy_hal { 30 31 class MockWifiLegacyHal : public WifiLegacyHal { 32 public: 33 MockWifiLegacyHal( 34 const std::weak_ptr<wifi_system::InterfaceTool> iface_tool); 35 MOCK_METHOD0(initialize, wifi_error()); 36 MOCK_METHOD0(start, wifi_error()); 37 MOCK_METHOD2(stop, wifi_error(std::unique_lock<std::recursive_mutex>*, 38 const std::function<void()>&)); 39 MOCK_METHOD2(setDfsFlag, wifi_error(const std::string&, bool)); 40 MOCK_METHOD2(registerRadioModeChangeCallbackHandler, 41 wifi_error(const std::string&, 42 const on_radio_mode_change_callback&)); 43 MOCK_METHOD1(getFirmwareVersion, std::pair<wifi_error, std::string>( 44 const std::string& iface_name)); 45 MOCK_METHOD1(getDriverVersion, std::pair<wifi_error, std::string>( 46 const std::string& iface_name)); 47 48 MOCK_METHOD2(selectTxPowerScenario, 49 wifi_error(const std::string& iface_name, 50 wifi_power_scenario scenario)); 51 MOCK_METHOD1(resetTxPowerScenario, 52 wifi_error(const std::string& iface_name)); 53 MOCK_METHOD2(nanRegisterCallbackHandlers, 54 wifi_error(const std::string&, const NanCallbackHandlers&)); 55 MOCK_METHOD2(nanDisableRequest, 56 wifi_error(const std::string&, transaction_id)); 57 MOCK_METHOD3(nanDataInterfaceDelete, 58 wifi_error(const std::string&, transaction_id, 59 const std::string&)); 60 MOCK_METHOD2(createVirtualInterface, 61 wifi_error(const std::string& ifname, 62 wifi_interface_type iftype)); 63 MOCK_METHOD1(deleteVirtualInterface, wifi_error(const std::string& ifname)); 64 }; 65 } // namespace legacy_hal 66 } // namespace implementation 67 } // namespace V1_4 68 } // namespace wifi 69 } // namespace hardware 70 } // namespace android 71 72 #endif // MOCK_WIFI_LEGACY_HAL_H_ 73