Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -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_DEVICE_ |
| 6 | #define SHILL_MOCK_DEVICE_ |
| 7 | |
Chris Masone | 46eaaf5 | 2011-05-24 13:08:30 -0700 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame] | 10 | #include <base/memory/ref_counted.h> |
| 11 | #include <gmock/gmock.h> |
| 12 | |
| 13 | #include "shill/device.h" |
| 14 | |
| 15 | namespace shill { |
| 16 | |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame] | 17 | class MockDevice : public Device { |
| 18 | public: |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame] | 19 | MockDevice(ControlInterface *control_interface, |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 20 | EventDispatcher *dispatcher, |
Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 21 | Metrics *metrics, |
Chris Masone | a82b711 | 2011-05-25 15:16:29 -0700 | [diff] [blame] | 22 | Manager *manager, |
| 23 | const std::string &link_name, |
Chris Masone | 626719f | 2011-08-18 16:58:48 -0700 | [diff] [blame] | 24 | const std::string &address, |
Chris Masone | a82b711 | 2011-05-25 15:16:29 -0700 | [diff] [blame] | 25 | int interface_index); |
| 26 | virtual ~MockDevice(); |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame] | 27 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 28 | MOCK_METHOD2(Start, void(Error *error, |
| 29 | const EnabledStateChangedCallback &callback)); |
| 30 | MOCK_METHOD2(Stop, void(Error *error, |
| 31 | const EnabledStateChangedCallback &callback)); |
| 32 | MOCK_METHOD1(SetEnabled, void(bool)); |
Jason Glasgow | df7c553 | 2012-05-14 14:41:45 -0400 | [diff] [blame] | 33 | MOCK_METHOD3(SetEnabledPersistent, void(bool enable, |
| 34 | Error* error, |
| 35 | const ResultCallback &callback)); |
Wade Guthrie | 4823f4f | 2013-07-25 10:03:03 -0700 | [diff] [blame] | 36 | MOCK_METHOD3(Scan, void(Device::ScanType scan_type, Error *error, |
| 37 | const std::string &reason)); |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 38 | MOCK_METHOD1(Load, bool(StoreInterface *storage)); |
| 39 | MOCK_METHOD1(Save, bool(StoreInterface *storage)); |
Paul Stewart | 2bf1d35 | 2011-12-06 15:02:55 -0800 | [diff] [blame] | 40 | MOCK_METHOD0(DisableIPv6, void()); |
| 41 | MOCK_METHOD0(EnableIPv6, void()); |
| 42 | MOCK_METHOD0(EnableIPv6Privacy, void()); |
Paul Stewart | c8f4bef | 2011-12-13 09:45:51 -0800 | [diff] [blame] | 43 | MOCK_METHOD0(DisableReversePathFilter, void()); |
| 44 | MOCK_METHOD0(EnableReversePathFilter, void()); |
Paul Stewart | d215af6 | 2012-04-24 23:25:50 -0700 | [diff] [blame] | 45 | MOCK_METHOD0(RestartPortalDetection, bool()); |
Paul Stewart | c681fa0 | 2012-03-02 19:40:04 -0800 | [diff] [blame] | 46 | MOCK_METHOD0(RequestPortalDetection, bool()); |
Ben Chan | b061f89 | 2013-02-27 17:46:55 -0800 | [diff] [blame] | 47 | MOCK_METHOD0(GetReceiveByteCount, uint64()); |
| 48 | MOCK_METHOD0(GetTransmitByteCount, uint64()); |
Paul Stewart | d215af6 | 2012-04-24 23:25:50 -0700 | [diff] [blame] | 49 | MOCK_CONST_METHOD1(IsConnectedToService, bool(const ServiceRefPtr &service)); |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 50 | MOCK_CONST_METHOD0(technology, Technology::Identifier()); |
mukesh agrawal | 784566d | 2012-08-08 18:32:58 -0700 | [diff] [blame] | 51 | MOCK_METHOD0(OnBeforeSuspend, void()); |
| 52 | MOCK_METHOD0(OnAfterResume, void()); |
Paul Stewart | 8596f9f | 2013-03-14 07:58:26 -0700 | [diff] [blame] | 53 | MOCK_METHOD0(OnConnectionUpdated, void()); |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame] | 54 | |
| 55 | private: |
| 56 | DISALLOW_COPY_AND_ASSIGN(MockDevice); |
| 57 | }; |
| 58 | |
| 59 | } // namespace shill |
| 60 | |
| 61 | #endif // SHILL_MOCK_DEVICE_ |