blob: 71ae32dffe787413b9521bbc70f44876076fb39f [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
5#ifndef SHILL_MOCK_DEVICE_INFO_
6#define SHILL_MOCK_DEVICE_INFO_
7
Hristo Stefanoved2c28c2011-11-29 15:37:30 -08008#include <vector>
9
Darin Petkov1bdedf12011-08-26 13:32:11 -070010#include <base/basictypes.h>
Chris Masone626719f2011-08-18 16:58:48 -070011#include <gmock/gmock.h>
12
13#include "shill/device_info.h"
14
15namespace shill {
16
17class ByteString;
18class ControlInterface;
19class EventDispatcher;
Paul Stewart05a42c22012-08-02 16:47:21 -070020class IPAddress;
Chris Masone626719f2011-08-18 16:58:48 -070021class Manager;
Thieu Le3426c8f2012-01-11 17:35:11 -080022class Metrics;
Chris Masone626719f2011-08-18 16:58:48 -070023
24class MockDeviceInfo : public DeviceInfo {
25 public:
26 MockDeviceInfo(ControlInterface *control_interface,
27 EventDispatcher *dispatcher,
Thieu Le3426c8f2012-01-11 17:35:11 -080028 Metrics *metrics,
Darin Petkov1bdedf12011-08-26 13:32:11 -070029 Manager *manager);
30 virtual ~MockDeviceInfo();
Chris Masone626719f2011-08-18 16:58:48 -070031
Paul Stewartc8f4bef2011-12-13 09:45:51 -080032 MOCK_CONST_METHOD1(GetDevice, DeviceRefPtr(int interface_index));
Darin Petkovf8046b82012-04-24 16:29:23 +020033 MOCK_CONST_METHOD1(GetIndex, int(const std::string &interface_name));
Hristo Stefanoved2c28c2011-11-29 15:37:30 -080034 MOCK_CONST_METHOD2(GetMACAddress, bool(int interface_index,
35 ByteString* address));
Gary Morainbf74a672012-07-30 16:27:19 -070036 MOCK_CONST_METHOD1(GetMACAddressFromKernel, ByteString(int interface_index));
Paul Stewart6ff27f52012-07-11 06:51:41 -070037 MOCK_CONST_METHOD3(GetByteCounts, bool(int interface_index,
38 uint64 *rx_bytes,
39 uint64 *tx_bytes));
Hristo Stefanoved2c28c2011-11-29 15:37:30 -080040 MOCK_CONST_METHOD2(GetFlags, bool(int interface_index,
41 unsigned int* flags));
42 MOCK_CONST_METHOD2(GetAddresses, bool(int interface_index,
43 std::vector<AddressData>* addresses));
44 MOCK_CONST_METHOD1(FlushAddresses, void(int interface_index));
Paul Stewart05a42c22012-08-02 16:47:21 -070045 MOCK_CONST_METHOD2(HasOtherAddress,
46 bool(int interface_index,
47 const IPAddress &excluded_address));
Paul Stewartca6abd42012-03-01 15:45:29 -080048 MOCK_CONST_METHOD1(CreateTunnelInterface, bool(std::string *interface_name));
49 MOCK_CONST_METHOD1(DeleteInterface, bool(int interface_index));
David Rochbergfa1d31d2012-03-20 10:38:07 -040050 MOCK_METHOD1(RegisterDevice, void(const DeviceRefPtr &));
51 MOCK_METHOD1(DeregisterDevice, void(const DeviceRefPtr &));
Chris Masone626719f2011-08-18 16:58:48 -070052
53 private:
54 DISALLOW_COPY_AND_ASSIGN(MockDeviceInfo);
55};
56
57} // namespace shill
58
59#endif // SHILL_MOCK_DEVICE_INFO_