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 | 626719f | 2011-08-18 16:58:48 -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_INFO_ |
| 6 | #define SHILL_MOCK_DEVICE_INFO_ |
| 7 | |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 8 | #include <vector> |
| 9 | |
Darin Petkov | 1bdedf1 | 2011-08-26 13:32:11 -0700 | [diff] [blame] | 10 | #include <base/basictypes.h> |
Chris Masone | 626719f | 2011-08-18 16:58:48 -0700 | [diff] [blame] | 11 | #include <gmock/gmock.h> |
| 12 | |
| 13 | #include "shill/device_info.h" |
| 14 | |
| 15 | namespace shill { |
| 16 | |
| 17 | class ByteString; |
| 18 | class ControlInterface; |
| 19 | class EventDispatcher; |
| 20 | class Manager; |
Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 21 | class Metrics; |
Chris Masone | 626719f | 2011-08-18 16:58:48 -0700 | [diff] [blame] | 22 | |
| 23 | class MockDeviceInfo : public DeviceInfo { |
| 24 | public: |
| 25 | MockDeviceInfo(ControlInterface *control_interface, |
| 26 | EventDispatcher *dispatcher, |
Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 27 | Metrics *metrics, |
Darin Petkov | 1bdedf1 | 2011-08-26 13:32:11 -0700 | [diff] [blame] | 28 | Manager *manager); |
| 29 | virtual ~MockDeviceInfo(); |
Chris Masone | 626719f | 2011-08-18 16:58:48 -0700 | [diff] [blame] | 30 | |
Paul Stewart | c8f4bef | 2011-12-13 09:45:51 -0800 | [diff] [blame] | 31 | MOCK_CONST_METHOD1(GetDevice, DeviceRefPtr(int interface_index)); |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 32 | MOCK_CONST_METHOD2(GetMACAddress, bool(int interface_index, |
| 33 | ByteString* address)); |
| 34 | MOCK_CONST_METHOD2(GetFlags, bool(int interface_index, |
| 35 | unsigned int* flags)); |
| 36 | MOCK_CONST_METHOD2(GetAddresses, bool(int interface_index, |
| 37 | std::vector<AddressData>* addresses)); |
| 38 | MOCK_CONST_METHOD1(FlushAddresses, void(int interface_index)); |
Paul Stewart | ca6abd4 | 2012-03-01 15:45:29 -0800 | [diff] [blame] | 39 | MOCK_CONST_METHOD1(CreateTunnelInterface, bool(std::string *interface_name)); |
| 40 | MOCK_CONST_METHOD1(DeleteInterface, bool(int interface_index)); |
David Rochberg | fa1d31d | 2012-03-20 10:38:07 -0400 | [diff] [blame] | 41 | MOCK_METHOD1(RegisterDevice, void(const DeviceRefPtr &)); |
| 42 | MOCK_METHOD1(DeregisterDevice, void(const DeviceRefPtr &)); |
Chris Masone | 626719f | 2011-08-18 16:58:48 -0700 | [diff] [blame] | 43 | |
| 44 | private: |
| 45 | DISALLOW_COPY_AND_ASSIGN(MockDeviceInfo); |
| 46 | }; |
| 47 | |
| 48 | } // namespace shill |
| 49 | |
| 50 | #endif // SHILL_MOCK_DEVICE_INFO_ |