mukesh agrawal | 8a3188d | 2011-12-01 20:56:44 +0000 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Ben Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 5 | #ifndef SHILL_MOCK_WIFI_H_ |
| 6 | #define SHILL_MOCK_WIFI_H_ |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 7 | |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 8 | #include <map> |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 9 | #include <string> |
| 10 | |
| 11 | #include <base/memory/ref_counted.h> |
| 12 | #include <gmock/gmock.h> |
| 13 | |
| 14 | #include "shill/key_value_store.h" |
| 15 | #include "shill/refptr_types.h" |
| 16 | #include "shill/wifi.h" |
mukesh agrawal | b20776f | 2012-02-10 16:00:36 -0800 | [diff] [blame] | 17 | #include "shill/wifi_endpoint.h" |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 18 | #include "shill/wifi_service.h" |
| 19 | |
| 20 | namespace shill { |
| 21 | |
| 22 | class ControlInterface; |
| 23 | class Error; |
| 24 | class EventDispatcher; |
| 25 | |
| 26 | class MockWiFi : public WiFi { |
| 27 | public: |
| 28 | MockWiFi(ControlInterface *control_interface, |
| 29 | EventDispatcher *dispatcher, |
Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 30 | Metrics *metrics, |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 31 | Manager *manager, |
| 32 | const std::string &link_name, |
| 33 | const std::string &address, |
| 34 | int interface_index); |
| 35 | virtual ~MockWiFi(); |
| 36 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 37 | MOCK_METHOD2(Start, void(Error *error, |
| 38 | const EnabledStateChangedCallback &callback)); |
| 39 | MOCK_METHOD2(Stop, void(Error *error, |
| 40 | const EnabledStateChangedCallback &callback)); |
Wade Guthrie | 4823f4f | 2013-07-25 10:03:03 -0700 | [diff] [blame] | 41 | MOCK_METHOD3(Scan, void(ScanType scan_type, Error *error, |
| 42 | const std::string &reason)); |
Paul Stewart | 835934a | 2012-12-06 19:27:09 -0800 | [diff] [blame] | 43 | MOCK_METHOD1(DisconnectFrom, void(WiFiService *service)); |
Paul Stewart | 835934a | 2012-12-06 19:27:09 -0800 | [diff] [blame] | 44 | MOCK_METHOD1(ClearCachedCredentials, void(const WiFiService *service)); |
Paul Stewart | a283e4e | 2013-10-22 20:50:14 -0700 | [diff] [blame] | 45 | MOCK_METHOD1(ConnectTo, void(WiFiService *service)); |
mukesh agrawal | 8a3188d | 2011-12-01 20:56:44 +0000 | [diff] [blame] | 46 | MOCK_CONST_METHOD0(IsIdle, bool()); |
Paul Stewart | 3c50401 | 2013-01-17 17:49:58 -0800 | [diff] [blame] | 47 | MOCK_METHOD1(NotifyEndpointChanged, |
| 48 | void(const WiFiEndpointConstRefPtr &endpoint)); |
Albert Chaulk | 0e1cdea | 2013-02-27 15:32:55 -0800 | [diff] [blame] | 49 | MOCK_METHOD1(DestroyIPConfigLease, void(const std::string &)); |
Paul Stewart | fa11e28 | 2013-12-02 22:04:25 -0800 | [diff] [blame] | 50 | MOCK_CONST_METHOD0(IsConnectedViaTether, bool()); |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 51 | |
| 52 | private: |
| 53 | DISALLOW_COPY_AND_ASSIGN(MockWiFi); |
| 54 | }; |
| 55 | |
| 56 | } // namespace shill |
| 57 | |
Ben Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 58 | #endif // SHILL_MOCK_WIFI_H_ |