blob: 45ed807bd46ea3747db0691edf4ef07d8c581c01 [file] [log] [blame]
Paul Stewartc681fa02012-03-02 19:40:04 -08001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Paul Stewartc1dec4d2011-12-08 15:25:28 -08002// 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 Vakulenko8a532292014-06-16 17:18:44 -07008#include <string>
9#include <vector>
10
Ben Chancc67c522014-09-03 07:19:18 -070011#include <base/macros.h>
Paul Stewartc1dec4d2011-12-08 15:25:28 -080012#include <gmock/gmock.h>
13
14#include "shill/connection.h"
15
16namespace shill {
17
18class MockConnection : public Connection {
19 public:
Alex Vakulenko8a532292014-06-16 17:18:44 -070020 explicit MockConnection(const DeviceInfo *device_info);
Ben Chan5ea763b2014-08-13 11:07:54 -070021 ~MockConnection() override;
Paul Stewartc1dec4d2011-12-08 15:25:28 -080022
23 MOCK_METHOD1(UpdateFromIPConfig, void(const IPConfigRefPtr &config));
Paul Stewartdf3c0a82012-11-09 15:54:33 -080024 MOCK_CONST_METHOD0(GetLowerConnection, ConnectionRefPtr());
Paul Stewartc681fa02012-03-02 19:40:04 -080025 MOCK_CONST_METHOD0(is_default, bool());
Paul Stewartc1dec4d2011-12-08 15:25:28 -080026 MOCK_METHOD1(SetIsDefault, void(bool is_default));
Paul Stewart10241e32012-04-23 18:15:06 -070027 MOCK_CONST_METHOD0(ipconfig_rpc_identifier, const std::string &());
Paul Stewartc8f4bef2011-12-13 09:45:51 -080028 MOCK_METHOD0(RequestRouting, void());
29 MOCK_METHOD0(ReleaseRouting, void());
30 MOCK_CONST_METHOD0(interface_name, const std::string &());
31 MOCK_CONST_METHOD0(dns_servers, const std::vector<std::string> &());
Paul Stewartce4ec192012-03-14 12:53:46 -070032 MOCK_METHOD1(RequestHostRoute, bool(const IPAddress &destination));
Prabhu Kaliamoorthi762bfb82015-02-06 13:17:08 +010033 MOCK_METHOD2(PinPendingRoutes,
34 bool(int interface_index, RoutingTableEntry entry));
Paul Stewart6c72c972012-07-27 11:29:20 -070035 MOCK_CONST_METHOD0(local, const IPAddress &());
36 MOCK_CONST_METHOD0(gateway, const IPAddress &());
Alex Deymofddc09a2013-07-03 18:41:31 -070037 MOCK_CONST_METHOD0(technology, Technology::Identifier());
Paul Stewart4a6748d2012-07-17 14:31:36 -070038 MOCK_METHOD0(CreateGatewayRoute, bool());
Alex Deymofddc09a2013-07-03 18:41:31 -070039 MOCK_METHOD0(GetCarrierConnection, ConnectionRefPtr());
Paul Stewart7f5d9c02013-12-03 18:26:00 -080040 MOCK_CONST_METHOD0(tethering, std::string &());
Peter Qiua89154b2014-05-23 15:45:42 -070041 MOCK_METHOD1(UpdateDNSServers,
42 void(const std::vector<std::string> &dns_servers));
Peter Qiuf3a8f902014-08-20 10:05:42 -070043 MOCK_METHOD0(IsIPv6, bool());
Paul Stewart2cb3fa72014-11-13 01:43:12 -080044 MOCK_CONST_METHOD0(GetSubnetName, std::string());
Paul Stewartc1dec4d2011-12-08 15:25:28 -080045
46 private:
47 DISALLOW_COPY_AND_ASSIGN(MockConnection);
48};
49
50} // namespace shill
51
52#endif // SHILL_MOCK_CONNECTION_H_