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 | |
Ben Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 5 | #ifndef SHILL_MOCK_IPCONFIG_H_ |
| 6 | #define SHILL_MOCK_IPCONFIG_H_ |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 7 | |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 8 | #include <string> |
Peter Qiu | a89154b | 2014-05-23 15:45:42 -0700 | [diff] [blame] | 9 | #include <vector> |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 10 | |
Ben Chan | cc67c52 | 2014-09-03 07:19:18 -0700 | [diff] [blame] | 11 | #include <base/macros.h> |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 12 | #include <gmock/gmock.h> |
| 13 | |
| 14 | #include "shill/ipconfig.h" |
| 15 | |
| 16 | namespace shill { |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 17 | |
| 18 | class MockIPConfig : public IPConfig { |
| 19 | public: |
| 20 | MockIPConfig(ControlInterface *control_interface, |
Darin Petkov | ef34f18 | 2011-08-26 14:14:40 -0700 | [diff] [blame] | 21 | const std::string &device_name); |
Ben Chan | 5ea763b | 2014-08-13 11:07:54 -0700 | [diff] [blame] | 22 | ~MockIPConfig() override; |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 23 | |
Thieu Le | 0302666 | 2013-04-04 10:45:11 -0700 | [diff] [blame] | 24 | MOCK_CONST_METHOD0(properties, const Properties &(void)); |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 25 | MOCK_METHOD0(RequestIP, bool(void)); |
| 26 | MOCK_METHOD0(RenewIP, bool(void)); |
Paul Stewart | 217c61d | 2013-06-13 15:12:02 -0700 | [diff] [blame] | 27 | MOCK_METHOD1(ReleaseIP, bool(ReleaseReason reason)); |
Paul Stewart | c509953 | 2013-12-12 07:53:15 -0800 | [diff] [blame] | 28 | MOCK_METHOD0(ResetProperties, void(void)); |
mukesh agrawal | 7aed61c | 2013-04-22 16:01:24 -0700 | [diff] [blame] | 29 | MOCK_METHOD0(EmitChanges, void(void)); |
Peter Qiu | a89154b | 2014-05-23 15:45:42 -0700 | [diff] [blame] | 30 | MOCK_METHOD1(UpdateDNSServers, |
| 31 | void(const std::vector<std::string> &dns_servers)); |
Samuel Tan | 815a6fb | 2014-10-23 16:53:59 -0700 | [diff] [blame] | 32 | MOCK_METHOD1(UpdateLeaseExpirationTime, void(uint32_t new_lease_duration)); |
| 33 | MOCK_METHOD0(ResetLeaseExpirationTime, void(void)); |
Darin Petkov | ef34f18 | 2011-08-26 14:14:40 -0700 | [diff] [blame] | 34 | |
| 35 | private: |
Thieu Le | 0302666 | 2013-04-04 10:45:11 -0700 | [diff] [blame] | 36 | const Properties &real_properties() { |
| 37 | return IPConfig::properties(); |
| 38 | } |
| 39 | |
Darin Petkov | ef34f18 | 2011-08-26 14:14:40 -0700 | [diff] [blame] | 40 | DISALLOW_COPY_AND_ASSIGN(MockIPConfig); |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | } // namespace shill |
| 44 | |
Ben Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 45 | #endif // SHILL_MOCK_IPCONFIG_H_ |