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_5 {
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         const wifi_hal_fn& fn, bool is_primary);
36     MOCK_METHOD0(initialize, wifi_error());
37     MOCK_METHOD0(start, wifi_error());
38     MOCK_METHOD2(stop, wifi_error(std::unique_lock<std::recursive_mutex>*,
39                                   const std::function<void()>&));
40     MOCK_METHOD2(setDfsFlag, wifi_error(const std::string&, bool));
41     MOCK_METHOD2(registerRadioModeChangeCallbackHandler,
42                  wifi_error(const std::string&,
43                             const on_radio_mode_change_callback&));
44     MOCK_METHOD1(getFirmwareVersion, std::pair<wifi_error, std::string>(
45                                          const std::string& iface_name));
46     MOCK_METHOD1(getDriverVersion, std::pair<wifi_error, std::string>(
47                                        const std::string& iface_name));
48 
49     MOCK_METHOD2(selectTxPowerScenario,
50                  wifi_error(const std::string& iface_name,
51                             wifi_power_scenario scenario));
52     MOCK_METHOD1(resetTxPowerScenario,
53                  wifi_error(const std::string& iface_name));
54     MOCK_METHOD2(nanRegisterCallbackHandlers,
55                  wifi_error(const std::string&, const NanCallbackHandlers&));
56     MOCK_METHOD2(nanDisableRequest,
57                  wifi_error(const std::string&, transaction_id));
58     MOCK_METHOD3(nanDataInterfaceDelete,
59                  wifi_error(const std::string&, transaction_id,
60                             const std::string&));
61     MOCK_METHOD2(createVirtualInterface,
62                  wifi_error(const std::string& ifname,
63                             wifi_interface_type iftype));
64     MOCK_METHOD1(deleteVirtualInterface, wifi_error(const std::string& ifname));
65     MOCK_METHOD0(waitForDriverReady, wifi_error());
66 };
67 }  // namespace legacy_hal
68 }  // namespace implementation
69 }  // namespace V1_5
70 }  // namespace wifi
71 }  // namespace hardware
72 }  // namespace android
73 
74 #endif  // MOCK_WIFI_LEGACY_HAL_H_
75