blob: 9e274f535ad5d53cff79eedbee9624adba3fae10 [file] [log] [blame]
Thieu Le3426c8f2012-01-11 17:35:11 -08001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Chris Masone9be4a9d2011-05-16 15:44:09 -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_
6#define SHILL_MOCK_DEVICE_
7
Chris Masone46eaaf52011-05-24 13:08:30 -07008#include <string>
9
Chris Masone9be4a9d2011-05-16 15:44:09 -070010#include <base/memory/ref_counted.h>
11#include <gmock/gmock.h>
12
13#include "shill/device.h"
14
15namespace shill {
16
Chris Masone9be4a9d2011-05-16 15:44:09 -070017class MockDevice : public Device {
18 public:
Chris Masone9be4a9d2011-05-16 15:44:09 -070019 MockDevice(ControlInterface *control_interface,
Paul Stewartb50f0b92011-05-16 16:31:42 -070020 EventDispatcher *dispatcher,
Thieu Le3426c8f2012-01-11 17:35:11 -080021 Metrics *metrics,
Chris Masonea82b7112011-05-25 15:16:29 -070022 Manager *manager,
23 const std::string &link_name,
Chris Masone626719f2011-08-18 16:58:48 -070024 const std::string &address,
Chris Masonea82b7112011-05-25 15:16:29 -070025 int interface_index);
26 virtual ~MockDevice();
Chris Masone9be4a9d2011-05-16 15:44:09 -070027
Eric Shienbrood9a245532012-03-07 14:20:39 -050028 MOCK_METHOD2(Start, void(Error *error,
29 const EnabledStateChangedCallback &callback));
30 MOCK_METHOD2(Stop, void(Error *error,
31 const EnabledStateChangedCallback &callback));
32 MOCK_METHOD1(SetEnabled, void(bool));
Jason Glasgowdf7c5532012-05-14 14:41:45 -040033 MOCK_METHOD3(SetEnabledPersistent, void(bool enable,
34 Error* error,
35 const ResultCallback &callback));
Wade Guthrie4823f4f2013-07-25 10:03:03 -070036 MOCK_METHOD3(Scan, void(Device::ScanType scan_type, Error *error,
37 const std::string &reason));
Eric Shienbrood9a245532012-03-07 14:20:39 -050038 MOCK_METHOD1(Load, bool(StoreInterface *storage));
39 MOCK_METHOD1(Save, bool(StoreInterface *storage));
Paul Stewart2bf1d352011-12-06 15:02:55 -080040 MOCK_METHOD0(DisableIPv6, void());
41 MOCK_METHOD0(EnableIPv6, void());
42 MOCK_METHOD0(EnableIPv6Privacy, void());
Paul Stewartc8f4bef2011-12-13 09:45:51 -080043 MOCK_METHOD0(DisableReversePathFilter, void());
44 MOCK_METHOD0(EnableReversePathFilter, void());
Paul Stewartd215af62012-04-24 23:25:50 -070045 MOCK_METHOD0(RestartPortalDetection, bool());
Paul Stewartc681fa02012-03-02 19:40:04 -080046 MOCK_METHOD0(RequestPortalDetection, bool());
Ben Chanb061f892013-02-27 17:46:55 -080047 MOCK_METHOD0(GetReceiveByteCount, uint64());
48 MOCK_METHOD0(GetTransmitByteCount, uint64());
Paul Stewartd215af62012-04-24 23:25:50 -070049 MOCK_CONST_METHOD1(IsConnectedToService, bool(const ServiceRefPtr &service));
Gaurav Shah435de2c2011-11-17 19:01:07 -080050 MOCK_CONST_METHOD0(technology, Technology::Identifier());
mukesh agrawal784566d2012-08-08 18:32:58 -070051 MOCK_METHOD0(OnBeforeSuspend, void());
52 MOCK_METHOD0(OnAfterResume, void());
Paul Stewart8596f9f2013-03-14 07:58:26 -070053 MOCK_METHOD0(OnConnectionUpdated, void());
Chris Masone9be4a9d2011-05-16 15:44:09 -070054
55 private:
56 DISALLOW_COPY_AND_ASSIGN(MockDevice);
57};
58
59} // namespace shill
60
61#endif // SHILL_MOCK_DEVICE_