Peter Qiu | c0beca5 | 2015-09-03 11:25:46 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2012 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 | // |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 16 | |
Ben Chan | d6a8b51 | 2014-11-18 10:45:15 -0800 | [diff] [blame] | 17 | #ifndef SHILL_WIFI_MOCK_WIFI_H_ |
| 18 | #define SHILL_WIFI_MOCK_WIFI_H_ |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 19 | |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 20 | #include <map> |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 21 | #include <string> |
| 22 | |
| 23 | #include <base/memory/ref_counted.h> |
| 24 | #include <gmock/gmock.h> |
| 25 | |
| 26 | #include "shill/key_value_store.h" |
| 27 | #include "shill/refptr_types.h" |
Ben Chan | d6a8b51 | 2014-11-18 10:45:15 -0800 | [diff] [blame] | 28 | #include "shill/wifi/wifi.h" |
| 29 | #include "shill/wifi/wifi_endpoint.h" |
| 30 | #include "shill/wifi/wifi_service.h" |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 31 | |
| 32 | namespace shill { |
| 33 | |
| 34 | class ControlInterface; |
| 35 | class Error; |
| 36 | class EventDispatcher; |
| 37 | |
| 38 | class MockWiFi : public WiFi { |
| 39 | public: |
Paul Stewart | 2b36390 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 40 | MockWiFi(ControlInterface* control_interface, |
| 41 | EventDispatcher* dispatcher, |
| 42 | Metrics* metrics, |
| 43 | Manager* manager, |
| 44 | const std::string& link_name, |
| 45 | const std::string& address, |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 46 | int interface_index); |
Ben Chan | 5ea763b | 2014-08-13 11:07:54 -0700 | [diff] [blame] | 47 | ~MockWiFi() override; |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 48 | |
Paul Stewart | 2b36390 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 49 | MOCK_METHOD2(Start, void(Error* error, |
| 50 | const EnabledStateChangedCallback& callback)); |
| 51 | MOCK_METHOD2(Stop, void(Error* error, |
| 52 | const EnabledStateChangedCallback& callback)); |
| 53 | MOCK_METHOD3(Scan, void(ScanType scan_type, Error* error, |
| 54 | const std::string& reason)); |
| 55 | MOCK_METHOD1(DisconnectFromIfActive, void(WiFiService* service)); |
| 56 | MOCK_METHOD1(DisconnectFrom, void(WiFiService* service)); |
| 57 | MOCK_METHOD1(ClearCachedCredentials, void(const WiFiService* service)); |
| 58 | MOCK_METHOD1(ConnectTo, void(WiFiService* service)); |
mukesh agrawal | 8a3188d | 2011-12-01 20:56:44 +0000 | [diff] [blame] | 59 | MOCK_CONST_METHOD0(IsIdle, bool()); |
Paul Stewart | 3c50401 | 2013-01-17 17:49:58 -0800 | [diff] [blame] | 60 | MOCK_METHOD1(NotifyEndpointChanged, |
Paul Stewart | 2b36390 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 61 | void(const WiFiEndpointConstRefPtr& endpoint)); |
| 62 | MOCK_METHOD1(DestroyIPConfigLease, void(const std::string&)); |
Paul Stewart | fa11e28 | 2013-12-02 22:04:25 -0800 | [diff] [blame] | 63 | MOCK_CONST_METHOD0(IsConnectedViaTether, bool()); |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 64 | |
| 65 | private: |
| 66 | DISALLOW_COPY_AND_ASSIGN(MockWiFi); |
| 67 | }; |
| 68 | |
| 69 | } // namespace shill |
| 70 | |
Ben Chan | d6a8b51 | 2014-11-18 10:45:15 -0800 | [diff] [blame] | 71 | #endif // SHILL_WIFI_MOCK_WIFI_H_ |