Peter Qiu | c0beca5 | 2015-09-03 11:25:46 -0700 | [diff] [blame^] | 1 | // |
| 2 | // Copyright (C) 2011 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 16 | |
Ben Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 17 | #ifndef SHILL_MOCK_IPCONFIG_H_ |
| 18 | #define SHILL_MOCK_IPCONFIG_H_ |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 19 | |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 20 | #include <string> |
Peter Qiu | a89154b | 2014-05-23 15:45:42 -0700 | [diff] [blame] | 21 | #include <vector> |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 22 | |
Ben Chan | cc67c52 | 2014-09-03 07:19:18 -0700 | [diff] [blame] | 23 | #include <base/macros.h> |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 24 | #include <gmock/gmock.h> |
| 25 | |
| 26 | #include "shill/ipconfig.h" |
| 27 | |
| 28 | namespace shill { |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 29 | |
| 30 | class MockIPConfig : public IPConfig { |
| 31 | public: |
Paul Stewart | 1e006c6 | 2015-06-16 12:29:06 -0700 | [diff] [blame] | 32 | MockIPConfig(ControlInterface* control_interface, |
| 33 | const std::string& device_name); |
Ben Chan | 5ea763b | 2014-08-13 11:07:54 -0700 | [diff] [blame] | 34 | ~MockIPConfig() override; |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 35 | |
Paul Stewart | 1e006c6 | 2015-06-16 12:29:06 -0700 | [diff] [blame] | 36 | MOCK_CONST_METHOD0(properties, const Properties& (void)); |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 37 | MOCK_METHOD0(RequestIP, bool(void)); |
| 38 | MOCK_METHOD0(RenewIP, bool(void)); |
Paul Stewart | 217c61d | 2013-06-13 15:12:02 -0700 | [diff] [blame] | 39 | MOCK_METHOD1(ReleaseIP, bool(ReleaseReason reason)); |
Paul Stewart | c509953 | 2013-12-12 07:53:15 -0800 | [diff] [blame] | 40 | MOCK_METHOD0(ResetProperties, void(void)); |
mukesh agrawal | 7aed61c | 2013-04-22 16:01:24 -0700 | [diff] [blame] | 41 | MOCK_METHOD0(EmitChanges, void(void)); |
Peter Qiu | a89154b | 2014-05-23 15:45:42 -0700 | [diff] [blame] | 42 | MOCK_METHOD1(UpdateDNSServers, |
Paul Stewart | 1e006c6 | 2015-06-16 12:29:06 -0700 | [diff] [blame] | 43 | void(const std::vector<std::string>& dns_servers)); |
Samuel Tan | 815a6fb | 2014-10-23 16:53:59 -0700 | [diff] [blame] | 44 | MOCK_METHOD1(UpdateLeaseExpirationTime, void(uint32_t new_lease_duration)); |
| 45 | MOCK_METHOD0(ResetLeaseExpirationTime, void(void)); |
Darin Petkov | ef34f18 | 2011-08-26 14:14:40 -0700 | [diff] [blame] | 46 | |
| 47 | private: |
Paul Stewart | 1e006c6 | 2015-06-16 12:29:06 -0700 | [diff] [blame] | 48 | const Properties& real_properties() { |
Thieu Le | 0302666 | 2013-04-04 10:45:11 -0700 | [diff] [blame] | 49 | return IPConfig::properties(); |
| 50 | } |
| 51 | |
Darin Petkov | ef34f18 | 2011-08-26 14:14:40 -0700 | [diff] [blame] | 52 | DISALLOW_COPY_AND_ASSIGN(MockIPConfig); |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 53 | }; |
| 54 | |
| 55 | } // namespace shill |
| 56 | |
Ben Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 57 | #endif // SHILL_MOCK_IPCONFIG_H_ |