Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 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_IPCONFIG_ |
| 6 | #define SHILL_MOCK_IPCONFIG_ |
| 7 | |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Darin Petkov | ef34f18 | 2011-08-26 14:14:40 -0700 | [diff] [blame] | 10 | #include <base/basictypes.h> |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 11 | #include <gmock/gmock.h> |
| 12 | |
| 13 | #include "shill/ipconfig.h" |
| 14 | |
| 15 | namespace shill { |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 16 | |
| 17 | class MockIPConfig : public IPConfig { |
| 18 | public: |
| 19 | MockIPConfig(ControlInterface *control_interface, |
Darin Petkov | ef34f18 | 2011-08-26 14:14:40 -0700 | [diff] [blame] | 20 | const std::string &device_name); |
| 21 | virtual ~MockIPConfig(); |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 22 | |
Thieu Le | 0302666 | 2013-04-04 10:45:11 -0700 | [diff] [blame] | 23 | MOCK_CONST_METHOD0(properties, const Properties &(void)); |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 24 | MOCK_METHOD0(RequestIP, bool(void)); |
| 25 | MOCK_METHOD0(RenewIP, bool(void)); |
| 26 | MOCK_METHOD0(ReleaseIP, bool(void)); |
| 27 | |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 28 | MOCK_METHOD2(Load, bool(StoreInterface *storage, |
| 29 | const std::string &id_suffix)); |
| 30 | MOCK_METHOD2(Save, bool(StoreInterface *storage, |
| 31 | const std::string &id_suffix)); |
mukesh agrawal | 7aed61c | 2013-04-22 16:01:24 -0700 | [diff] [blame] | 32 | MOCK_METHOD0(EmitChanges, void(void)); |
Darin Petkov | ef34f18 | 2011-08-26 14:14:40 -0700 | [diff] [blame] | 33 | |
| 34 | private: |
Thieu Le | 0302666 | 2013-04-04 10:45:11 -0700 | [diff] [blame] | 35 | const Properties &real_properties() { |
| 36 | return IPConfig::properties(); |
| 37 | } |
| 38 | |
Darin Petkov | ef34f18 | 2011-08-26 14:14:40 -0700 | [diff] [blame] | 39 | DISALLOW_COPY_AND_ASSIGN(MockIPConfig); |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 40 | }; |
| 41 | |
| 42 | } // namespace shill |
| 43 | |
| 44 | #endif // SHILL_MOCK_IPCONFIG_ |