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 | |
| 5 | #ifndef SHILL_MOCK_WIFI_ |
| 6 | #define SHILL_MOCK_WIFI_ |
| 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" |
| 17 | #include "shill/wifi_service.h" |
| 18 | |
| 19 | namespace shill { |
| 20 | |
| 21 | class ControlInterface; |
| 22 | class Error; |
| 23 | class EventDispatcher; |
| 24 | |
| 25 | class MockWiFi : public WiFi { |
| 26 | public: |
| 27 | MockWiFi(ControlInterface *control_interface, |
| 28 | EventDispatcher *dispatcher, |
Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 29 | Metrics *metrics, |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 30 | Manager *manager, |
| 31 | const std::string &link_name, |
| 32 | const std::string &address, |
| 33 | int interface_index); |
| 34 | virtual ~MockWiFi(); |
| 35 | |
| 36 | MOCK_METHOD0(Start, void()); |
| 37 | MOCK_METHOD0(Stop, void()); |
| 38 | MOCK_METHOD1(Scan, void(Error *error)); |
| 39 | MOCK_METHOD2(GetService, |
| 40 | WiFiServiceRefPtr(const KeyValueStore &args, Error *error)); |
mukesh agrawal | 6e27777 | 2011-09-29 15:04:23 -0700 | [diff] [blame] | 41 | MOCK_METHOD2(ConnectTo, |
mukesh agrawal | 6489632 | 2011-12-01 01:13:10 +0000 | [diff] [blame] | 42 | void(WiFiService *service, |
| 43 | std::map<std::string, ::DBus::Variant> service_params)); |
mukesh agrawal | 8a3188d | 2011-12-01 20:56:44 +0000 | [diff] [blame] | 44 | MOCK_CONST_METHOD0(IsIdle, bool()); |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 45 | |
| 46 | private: |
| 47 | DISALLOW_COPY_AND_ASSIGN(MockWiFi); |
| 48 | }; |
| 49 | |
| 50 | } // namespace shill |
| 51 | |
| 52 | #endif // SHILL_MOCK_WIFI_ |