blob: 167cae46b48a9e36e4745e6d8085be786632da46 [file] [log] [blame]
Peter Qiuc0beca52015-09-03 11:25:46 -07001//
2// Copyright (C) 2012 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
mukesh agrawal7a4e4002011-09-06 11:26:05 -070016
Ben Chand6a8b512014-11-18 10:45:15 -080017#ifndef SHILL_WIFI_MOCK_WIFI_H_
18#define SHILL_WIFI_MOCK_WIFI_H_
mukesh agrawal7a4e4002011-09-06 11:26:05 -070019
Hristo Stefanoved2c28c2011-11-29 15:37:30 -080020#include <map>
mukesh agrawal7a4e4002011-09-06 11:26:05 -070021#include <string>
22
23#include <base/memory/ref_counted.h>
24#include <gmock/gmock.h>
25
26#include "shill/key_value_store.h"
27#include "shill/refptr_types.h"
Ben Chand6a8b512014-11-18 10:45:15 -080028#include "shill/wifi/wifi.h"
29#include "shill/wifi/wifi_endpoint.h"
30#include "shill/wifi/wifi_service.h"
mukesh agrawal7a4e4002011-09-06 11:26:05 -070031
32namespace shill {
33
34class ControlInterface;
35class Error;
36class EventDispatcher;
37
38class MockWiFi : public WiFi {
39 public:
Paul Stewart2b363902015-06-16 13:13:10 -070040 MockWiFi(ControlInterface* control_interface,
41 EventDispatcher* dispatcher,
42 Metrics* metrics,
43 Manager* manager,
44 const std::string& link_name,
45 const std::string& address,
mukesh agrawal7a4e4002011-09-06 11:26:05 -070046 int interface_index);
Ben Chan5ea763b2014-08-13 11:07:54 -070047 ~MockWiFi() override;
mukesh agrawal7a4e4002011-09-06 11:26:05 -070048
Paul Stewart2b363902015-06-16 13:13:10 -070049 MOCK_METHOD2(Start, void(Error* error,
50 const EnabledStateChangedCallback& callback));
51 MOCK_METHOD2(Stop, void(Error* error,
52 const EnabledStateChangedCallback& callback));
53 MOCK_METHOD3(Scan, void(ScanType scan_type, Error* error,
54 const std::string& reason));
55 MOCK_METHOD1(DisconnectFromIfActive, void(WiFiService* service));
56 MOCK_METHOD1(DisconnectFrom, void(WiFiService* service));
57 MOCK_METHOD1(ClearCachedCredentials, void(const WiFiService* service));
58 MOCK_METHOD1(ConnectTo, void(WiFiService* service));
mukesh agrawal8a3188d2011-12-01 20:56:44 +000059 MOCK_CONST_METHOD0(IsIdle, bool());
Paul Stewart3c504012013-01-17 17:49:58 -080060 MOCK_METHOD1(NotifyEndpointChanged,
Paul Stewart2b363902015-06-16 13:13:10 -070061 void(const WiFiEndpointConstRefPtr& endpoint));
62 MOCK_METHOD1(DestroyIPConfigLease, void(const std::string&));
Paul Stewartfa11e282013-12-02 22:04:25 -080063 MOCK_CONST_METHOD0(IsConnectedViaTether, bool());
mukesh agrawal7a4e4002011-09-06 11:26:05 -070064
65 private:
66 DISALLOW_COPY_AND_ASSIGN(MockWiFi);
67};
68
69} // namespace shill
70
Ben Chand6a8b512014-11-18 10:45:15 -080071#endif // SHILL_WIFI_MOCK_WIFI_H_