Paul Stewart | c681fa0 | 2012-03-02 19:40:04 -0800 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Paul Stewart | c1dec4d | 2011-12-08 15:25:28 -0800 | [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_CONNECTION_H_ |
| 6 | #define SHILL_MOCK_CONNECTION_H_ |
| 7 | |
Alex Vakulenko | 8a53229 | 2014-06-16 17:18:44 -0700 | [diff] [blame] | 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
Ben Chan | cc67c52 | 2014-09-03 07:19:18 -0700 | [diff] [blame] | 11 | #include <base/macros.h> |
Paul Stewart | c1dec4d | 2011-12-08 15:25:28 -0800 | [diff] [blame] | 12 | #include <gmock/gmock.h> |
| 13 | |
| 14 | #include "shill/connection.h" |
| 15 | |
| 16 | namespace shill { |
| 17 | |
| 18 | class MockConnection : public Connection { |
| 19 | public: |
Paul Stewart | 1e006c6 | 2015-06-16 12:29:06 -0700 | [diff] [blame^] | 20 | explicit MockConnection(const DeviceInfo* device_info); |
Ben Chan | 5ea763b | 2014-08-13 11:07:54 -0700 | [diff] [blame] | 21 | ~MockConnection() override; |
Paul Stewart | c1dec4d | 2011-12-08 15:25:28 -0800 | [diff] [blame] | 22 | |
Paul Stewart | 1e006c6 | 2015-06-16 12:29:06 -0700 | [diff] [blame^] | 23 | MOCK_METHOD1(UpdateFromIPConfig, void(const IPConfigRefPtr& config)); |
Paul Stewart | df3c0a8 | 2012-11-09 15:54:33 -0800 | [diff] [blame] | 24 | MOCK_CONST_METHOD0(GetLowerConnection, ConnectionRefPtr()); |
Paul Stewart | c681fa0 | 2012-03-02 19:40:04 -0800 | [diff] [blame] | 25 | MOCK_CONST_METHOD0(is_default, bool()); |
Paul Stewart | c1dec4d | 2011-12-08 15:25:28 -0800 | [diff] [blame] | 26 | MOCK_METHOD1(SetIsDefault, void(bool is_default)); |
Paul Stewart | 1e006c6 | 2015-06-16 12:29:06 -0700 | [diff] [blame^] | 27 | MOCK_CONST_METHOD0(ipconfig_rpc_identifier, const std::string&()); |
Paul Stewart | c8f4bef | 2011-12-13 09:45:51 -0800 | [diff] [blame] | 28 | MOCK_METHOD0(RequestRouting, void()); |
| 29 | MOCK_METHOD0(ReleaseRouting, void()); |
Paul Stewart | 1e006c6 | 2015-06-16 12:29:06 -0700 | [diff] [blame^] | 30 | MOCK_CONST_METHOD0(interface_name, const std::string&()); |
| 31 | MOCK_CONST_METHOD0(dns_servers, const std::vector<std::string>&()); |
| 32 | MOCK_METHOD1(RequestHostRoute, bool(const IPAddress& destination)); |
Prabhu Kaliamoorthi | 762bfb8 | 2015-02-06 13:17:08 +0100 | [diff] [blame] | 33 | MOCK_METHOD2(PinPendingRoutes, |
| 34 | bool(int interface_index, RoutingTableEntry entry)); |
Paul Stewart | 1e006c6 | 2015-06-16 12:29:06 -0700 | [diff] [blame^] | 35 | MOCK_CONST_METHOD0(local, const IPAddress&()); |
| 36 | MOCK_CONST_METHOD0(gateway, const IPAddress&()); |
Alex Deymo | fddc09a | 2013-07-03 18:41:31 -0700 | [diff] [blame] | 37 | MOCK_CONST_METHOD0(technology, Technology::Identifier()); |
Paul Stewart | 4a6748d | 2012-07-17 14:31:36 -0700 | [diff] [blame] | 38 | MOCK_METHOD0(CreateGatewayRoute, bool()); |
Alex Deymo | fddc09a | 2013-07-03 18:41:31 -0700 | [diff] [blame] | 39 | MOCK_METHOD0(GetCarrierConnection, ConnectionRefPtr()); |
Paul Stewart | 1e006c6 | 2015-06-16 12:29:06 -0700 | [diff] [blame^] | 40 | MOCK_CONST_METHOD0(tethering, std::string&()); |
Peter Qiu | a89154b | 2014-05-23 15:45:42 -0700 | [diff] [blame] | 41 | MOCK_METHOD1(UpdateDNSServers, |
Paul Stewart | 1e006c6 | 2015-06-16 12:29:06 -0700 | [diff] [blame^] | 42 | void(const std::vector<std::string>& dns_servers)); |
Peter Qiu | f3a8f90 | 2014-08-20 10:05:42 -0700 | [diff] [blame] | 43 | MOCK_METHOD0(IsIPv6, bool()); |
Paul Stewart | 2cb3fa7 | 2014-11-13 01:43:12 -0800 | [diff] [blame] | 44 | MOCK_CONST_METHOD0(GetSubnetName, std::string()); |
Paul Stewart | c1dec4d | 2011-12-08 15:25:28 -0800 | [diff] [blame] | 45 | |
| 46 | private: |
| 47 | DISALLOW_COPY_AND_ASSIGN(MockConnection); |
| 48 | }; |
| 49 | |
| 50 | } // namespace shill |
| 51 | |
| 52 | #endif // SHILL_MOCK_CONNECTION_H_ |