blob: baba61fe320420d3078885366645b59bcbea90ad [file] [log] [blame]
Thieu Le3426c8f2012-01-11 17:35:11 -08001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Chris Masone626719f2011-08-18 16:58:48 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Ben Chanc45688b2014-07-02 23:50:45 -07005#ifndef SHILL_MOCK_DEVICE_INFO_H_
6#define SHILL_MOCK_DEVICE_INFO_H_
Chris Masone626719f2011-08-18 16:58:48 -07007
Alex Vakulenko8a532292014-06-16 17:18:44 -07008#include <string>
Hristo Stefanoved2c28c2011-11-29 15:37:30 -08009#include <vector>
10
Darin Petkov1bdedf12011-08-26 13:32:11 -070011#include <base/basictypes.h>
Chris Masone626719f2011-08-18 16:58:48 -070012#include <gmock/gmock.h>
13
14#include "shill/device_info.h"
15
16namespace shill {
17
18class ByteString;
19class ControlInterface;
20class EventDispatcher;
Paul Stewart05a42c22012-08-02 16:47:21 -070021class IPAddress;
Chris Masone626719f2011-08-18 16:58:48 -070022class Manager;
Thieu Le3426c8f2012-01-11 17:35:11 -080023class Metrics;
Chris Masone626719f2011-08-18 16:58:48 -070024
25class MockDeviceInfo : public DeviceInfo {
26 public:
27 MockDeviceInfo(ControlInterface *control_interface,
28 EventDispatcher *dispatcher,
Thieu Le3426c8f2012-01-11 17:35:11 -080029 Metrics *metrics,
Darin Petkov1bdedf12011-08-26 13:32:11 -070030 Manager *manager);
31 virtual ~MockDeviceInfo();
Chris Masone626719f2011-08-18 16:58:48 -070032
mukesh agrawal12533ad2013-08-01 15:43:23 -070033 MOCK_METHOD1(IsDeviceBlackListed, bool(const std::string &device_name));
Paul Stewartc8f4bef2011-12-13 09:45:51 -080034 MOCK_CONST_METHOD1(GetDevice, DeviceRefPtr(int interface_index));
Darin Petkovf8046b82012-04-24 16:29:23 +020035 MOCK_CONST_METHOD1(GetIndex, int(const std::string &interface_name));
Hristo Stefanoved2c28c2011-11-29 15:37:30 -080036 MOCK_CONST_METHOD2(GetMACAddress, bool(int interface_index,
Paul Stewartc67f0bd2013-12-06 12:14:50 -080037 ByteString *address));
Gary Morainbf74a672012-07-30 16:27:19 -070038 MOCK_CONST_METHOD1(GetMACAddressFromKernel, ByteString(int interface_index));
Paul Stewartc67f0bd2013-12-06 12:14:50 -080039 MOCK_CONST_METHOD3(GetMACAddressOfPeer,
40 bool(int interface_index,
41 const IPAddress &peer,
42 ByteString *address));
Paul Stewart6ff27f52012-07-11 06:51:41 -070043 MOCK_CONST_METHOD3(GetByteCounts, bool(int interface_index,
Ben Chan7fab8972014-08-10 17:14:46 -070044 uint64_t *rx_bytes,
45 uint64_t *tx_bytes));
Hristo Stefanoved2c28c2011-11-29 15:37:30 -080046 MOCK_CONST_METHOD2(GetFlags, bool(int interface_index,
47 unsigned int* flags));
48 MOCK_CONST_METHOD2(GetAddresses, bool(int interface_index,
49 std::vector<AddressData>* addresses));
50 MOCK_CONST_METHOD1(FlushAddresses, void(int interface_index));
Paul Stewart05a42c22012-08-02 16:47:21 -070051 MOCK_CONST_METHOD2(HasOtherAddress,
52 bool(int interface_index,
53 const IPAddress &excluded_address));
Paul Stewarta0db0ff2013-12-09 09:48:47 -080054 MOCK_CONST_METHOD2(HasDirectConnectivityTo,
55 bool(int interface_index,
56 const IPAddress &address));
Paul Stewartd4f26482014-04-25 19:12:03 -070057 MOCK_METHOD2(GetPrimaryIPv6Address,
58 bool(int interface_index, IPAddress *address));
Paul Stewartca6abd42012-03-01 15:45:29 -080059 MOCK_CONST_METHOD1(CreateTunnelInterface, bool(std::string *interface_name));
60 MOCK_CONST_METHOD1(DeleteInterface, bool(int interface_index));
David Rochbergfa1d31d2012-03-20 10:38:07 -040061 MOCK_METHOD1(RegisterDevice, void(const DeviceRefPtr &));
62 MOCK_METHOD1(DeregisterDevice, void(const DeviceRefPtr &));
Chris Masone626719f2011-08-18 16:58:48 -070063
64 private:
65 DISALLOW_COPY_AND_ASSIGN(MockDeviceInfo);
66};
67
68} // namespace shill
69
Ben Chanc45688b2014-07-02 23:50:45 -070070#endif // SHILL_MOCK_DEVICE_INFO_H_