blob: 292b6d3a0b8ea0835788d8ea5bf6bf36054b5a53 [file] [log] [blame]
mukesh agrawal8a3188d2011-12-01 20:56:44 +00001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
mukesh agrawal7a4e4002011-09-06 11:26:05 -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_WIFI_
6#define SHILL_MOCK_WIFI_
7
Hristo Stefanoved2c28c2011-11-29 15:37:30 -08008#include <map>
mukesh agrawal7a4e4002011-09-06 11:26:05 -07009#include <string>
10
11#include <base/memory/ref_counted.h>
12#include <gmock/gmock.h>
13
14#include "shill/key_value_store.h"
15#include "shill/refptr_types.h"
16#include "shill/wifi.h"
mukesh agrawalb20776f2012-02-10 16:00:36 -080017#include "shill/wifi_endpoint.h"
mukesh agrawal7a4e4002011-09-06 11:26:05 -070018#include "shill/wifi_service.h"
19
20namespace shill {
21
22class ControlInterface;
23class Error;
24class EventDispatcher;
25
26class MockWiFi : public WiFi {
27 public:
28 MockWiFi(ControlInterface *control_interface,
29 EventDispatcher *dispatcher,
Thieu Le3426c8f2012-01-11 17:35:11 -080030 Metrics *metrics,
mukesh agrawal7a4e4002011-09-06 11:26:05 -070031 Manager *manager,
32 const std::string &link_name,
33 const std::string &address,
34 int interface_index);
35 virtual ~MockWiFi();
36
Eric Shienbrood9a245532012-03-07 14:20:39 -050037 MOCK_METHOD2(Start, void(Error *error,
38 const EnabledStateChangedCallback &callback));
39 MOCK_METHOD2(Stop, void(Error *error,
40 const EnabledStateChangedCallback &callback));
mukesh agrawal7a4e4002011-09-06 11:26:05 -070041 MOCK_METHOD1(Scan, void(Error *error));
Paul Stewart835934a2012-12-06 19:27:09 -080042 MOCK_METHOD1(DisconnectFrom, void(WiFiService *service));
mukesh agrawal7a4e4002011-09-06 11:26:05 -070043 MOCK_METHOD2(GetService,
44 WiFiServiceRefPtr(const KeyValueStore &args, Error *error));
Paul Stewart835934a2012-12-06 19:27:09 -080045 MOCK_METHOD1(ClearCachedCredentials, void(const WiFiService *service));
mukesh agrawal6e277772011-09-29 15:04:23 -070046 MOCK_METHOD2(ConnectTo,
mukesh agrawal64896322011-12-01 01:13:10 +000047 void(WiFiService *service,
48 std::map<std::string, ::DBus::Variant> service_params));
mukesh agrawal8a3188d2011-12-01 20:56:44 +000049 MOCK_CONST_METHOD0(IsIdle, bool());
mukesh agrawalb20776f2012-02-10 16:00:36 -080050 MOCK_METHOD1(NotifyEndpointChanged, void(const WiFiEndpoint &endpoint));
mukesh agrawal7a4e4002011-09-06 11:26:05 -070051
52 private:
53 DISALLOW_COPY_AND_ASSIGN(MockWiFi);
54};
55
56} // namespace shill
57
58#endif // SHILL_MOCK_WIFI_