• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_MOCK_NETWORK_LIBRARY_H_
6 #define CHROME_BROWSER_CHROMEOS_CROS_MOCK_NETWORK_LIBRARY_H_
7 #pragma once
8 
9 #include <string>
10 
11 #include "chrome/browser/chromeos/cros/network_library.h"
12 #include "testing/gmock/include/gmock/gmock.h"
13 
14 namespace chromeos {
15 
16 class MockNetworkLibrary : public NetworkLibrary {
17  public:
MockNetworkLibrary()18   MockNetworkLibrary() {}
~MockNetworkLibrary()19   virtual ~MockNetworkLibrary() {}
20   MOCK_METHOD1(AddNetworkManagerObserver, void(NetworkManagerObserver*));
21   MOCK_METHOD1(RemoveNetworkManagerObserver, void(NetworkManagerObserver*));
22   MOCK_METHOD2(AddNetworkObserver, void(const std::string&, NetworkObserver*));
23   MOCK_METHOD2(RemoveNetworkObserver, void(const std::string&,
24                                            NetworkObserver*));
25   MOCK_METHOD1(RemoveObserverForAllNetworks, void(NetworkObserver*));
26   MOCK_METHOD2(AddNetworkDeviceObserver, void(const std::string&,
27                                               NetworkDeviceObserver*));
28   MOCK_METHOD2(RemoveNetworkDeviceObserver, void(const std::string&,
29                                                  NetworkDeviceObserver*));
30   MOCK_METHOD1(AddCellularDataPlanObserver, void(CellularDataPlanObserver*));
31   MOCK_METHOD1(RemoveCellularDataPlanObserver, void(CellularDataPlanObserver*));
32   MOCK_METHOD1(AddPinOperationObserver, void(PinOperationObserver*));
33   MOCK_METHOD1(RemovePinOperationObserver, void(PinOperationObserver*));
34   MOCK_METHOD1(AddUserActionObserver, void(UserActionObserver*));
35   MOCK_METHOD1(RemoveUserActionObserver, void(UserActionObserver*));
36   MOCK_METHOD0(Lock, void(void));
37   MOCK_METHOD0(Unlock, void(void));
38   MOCK_METHOD0(IsLocked, bool(void));
39   MOCK_CONST_METHOD0(ethernet_network, const EthernetNetwork*(void));
40   MOCK_CONST_METHOD0(ethernet_connecting, bool(void));
41   MOCK_CONST_METHOD0(ethernet_connected, bool(void));
42 
43   MOCK_CONST_METHOD0(wifi_network, const WifiNetwork*(void));
44   MOCK_CONST_METHOD0(wifi_connecting, bool(void));
45   MOCK_CONST_METHOD0(wifi_connected, bool(void));
46 
47   MOCK_CONST_METHOD0(cellular_network, const CellularNetwork*(void));
48   MOCK_CONST_METHOD0(cellular_connecting, bool(void));
49   MOCK_CONST_METHOD0(cellular_connected, bool(void));
50 
51   MOCK_CONST_METHOD0(virtual_network, const VirtualNetwork*(void));
52   MOCK_CONST_METHOD0(virtual_network_connecting, bool(void));
53   MOCK_CONST_METHOD0(virtual_network_connected, bool(void));
54 
55   MOCK_CONST_METHOD0(Connected, bool(void));
56   MOCK_CONST_METHOD0(Connecting, bool(void));
57 
58   MOCK_CONST_METHOD0(IPAddress, const std::string&(void));
59   MOCK_CONST_METHOD0(wifi_networks, const WifiNetworkVector&(void));
60   MOCK_CONST_METHOD0(remembered_wifi_networks, const WifiNetworkVector&(void));
61   MOCK_CONST_METHOD0(cellular_networks, const CellularNetworkVector&(void));
62   MOCK_CONST_METHOD0(virtual_networks, const VirtualNetworkVector&(void));
63 
64   MOCK_CONST_METHOD1(FindNetworkDeviceByPath,
65                      NetworkDevice*(const std::string&));
66   MOCK_CONST_METHOD0(FindCellularDevice, const NetworkDevice*(void));
67   MOCK_CONST_METHOD0(FindWifiDevice, const NetworkDevice*(void));
68   MOCK_CONST_METHOD0(FindEthernetDevice, const NetworkDevice*(void));
69   MOCK_CONST_METHOD1(FindNetworkByPath,
70                      Network*(const std::string&));
71   MOCK_CONST_METHOD1(FindWifiNetworkByPath,
72                      WifiNetwork*(const std::string&));
73   MOCK_CONST_METHOD1(FindCellularNetworkByPath,
74                      CellularNetwork*(const std::string&));
75   MOCK_CONST_METHOD1(FindVirtualNetworkByPath,
76                      VirtualNetwork*(const std::string&));
77   MOCK_CONST_METHOD1(FindNetworkFromRemembered,Network*(const Network*));
78   MOCK_CONST_METHOD1(GetDataPlans,
79                      CellularDataPlanVector*(const std::string&));
80   MOCK_CONST_METHOD1(GetSignificantDataPlan,
81                      CellularDataPlan*(const std::string&));
82 
83   MOCK_METHOD2(ChangePin, void(const std::string&, const std::string&));
84   MOCK_METHOD2(ChangeRequirePin, void(bool, const std::string&));
85   MOCK_METHOD1(EnterPin, void(const std::string&));
86   MOCK_METHOD2(UnblockPin, void(const std::string&, const std::string&));
87 
88   MOCK_METHOD0(RequestCellularScan, void());
89   MOCK_METHOD1(RequestCellularRegister, void(const std::string&));
90   MOCK_METHOD1(SetCellularDataRoamingAllowed, void(bool));
91 
92   MOCK_METHOD0(RequestNetworkScan, void(void));
93   MOCK_METHOD1(GetWifiAccessPoints, bool(WifiAccessPointVector*));
94   MOCK_METHOD1(ConnectToWifiNetwork, void(WifiNetwork*));
95   MOCK_METHOD1(ConnectToWifiNetwork, void(const std::string&));
96   MOCK_METHOD5(ConnectToWifiNetwork, void(ConnectionSecurity security,
97                                           const std::string&,
98                                           const std::string&,
99                                           const std::string&,
100                                           const std::string&));
101   MOCK_METHOD1(ConnectToCellularNetwork, void(CellularNetwork*));
102   MOCK_METHOD1(ConnectToVirtualNetwork, void(VirtualNetwork*));
103   MOCK_METHOD5(ConnectToVirtualNetworkPSK, void(const std::string&,
104                                                 const std::string&,
105                                                 const std::string&,
106                                                 const std::string&,
107                                                 const std::string&));
108   MOCK_METHOD0(SignalCellularPlanPayment, void(void));
109   MOCK_METHOD0(HasRecentCellularPlanPayment, bool(void));
110 
111   MOCK_METHOD1(DisconnectFromNetwork, void(const Network*));
112   MOCK_METHOD1(ForgetWifiNetwork, void(const std::string&));
113   MOCK_CONST_METHOD0(GetCellularHomeCarrierId, std::string(void));
114 
115   MOCK_CONST_METHOD0(ethernet_available, bool(void));
116   MOCK_CONST_METHOD0(wifi_available, bool(void));
117   MOCK_CONST_METHOD0(cellular_available, bool(void));
118 
119   MOCK_CONST_METHOD0(ethernet_enabled, bool(void));
120   MOCK_CONST_METHOD0(wifi_enabled, bool(void));
121   MOCK_CONST_METHOD0(cellular_enabled, bool(void));
122 
123   MOCK_CONST_METHOD0(wifi_scanning, bool(void));
124 
125   MOCK_CONST_METHOD0(active_network, const Network*(void));
126   MOCK_CONST_METHOD0(connected_network, const Network*(void));
127 
128   MOCK_CONST_METHOD0(offline_mode, bool(void));
129 
130   MOCK_METHOD1(EnableEthernetNetworkDevice, void(bool));
131   MOCK_METHOD1(EnableWifiNetworkDevice, void(bool));
132   MOCK_METHOD1(EnableCellularNetworkDevice, void(bool));
133   MOCK_METHOD1(EnableOfflineMode, void(bool));
134   MOCK_METHOD3(GetIPConfigs, NetworkIPConfigVector(const std::string&,
135                                                    std::string*,
136                                                    HardwareAddressFormat));
137   MOCK_METHOD1(GetHtmlInfo, std::string(int));
138 };
139 
140 }  // namespace chromeos
141 
142 #endif  // CHROME_BROWSER_CHROMEOS_CROS_MOCK_NETWORK_LIBRARY_H_
143