OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMEOS_COMPONENTS_TETHER_FAKE_WIFI_HOTSPOT_CONNECTOR_H_ | 5 #ifndef CHROMEOS_COMPONENTS_TETHER_FAKE_WIFI_HOTSPOT_CONNECTOR_H_ |
6 #define CHROMEOS_COMPONENTS_TETHER_FAKE_WIFI_HOTSPOT_CONNECTOR_H_ | 6 #define CHROMEOS_COMPONENTS_TETHER_FAKE_WIFI_HOTSPOT_CONNECTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "chromeos/components/tether/wifi_hotspot_connector.h" | 11 #include "chromeos/components/tether/wifi_hotspot_connector.h" |
12 | 12 |
13 namespace chromeos { | 13 namespace chromeos { |
14 | 14 |
15 namespace tether { | 15 namespace tether { |
16 | 16 |
17 // Test double for WifiHotspotConnector. | 17 // Test double for WifiHotspotConnector. |
18 class FakeWifiHotspotConnector : public WifiHotspotConnector { | 18 class FakeWifiHotspotConnector : public WifiHotspotConnector { |
19 public: | 19 public: |
20 FakeWifiHotspotConnector(NetworkStateHandler* network_state_handler); | 20 FakeWifiHotspotConnector(NetworkStateHandler* network_state_handler); |
21 ~FakeWifiHotspotConnector() override; | 21 ~FakeWifiHotspotConnector() override; |
22 | 22 |
23 // Pass an empty string for |wifi_guid| to signify a failed connection. | 23 // Pass an empty string for |wifi_guid| to signify a failed connection. |
24 void CallMostRecentCallback(const std::string& wifi_guid); | 24 void CallMostRecentCallback(const std::string& wifi_guid); |
25 | 25 |
26 std::string most_recent_ssid() { return most_recent_ssid_; } | 26 std::string most_recent_ssid() { return most_recent_ssid_; } |
27 | 27 |
28 std::string most_recent_password() { return most_recent_password_; } | 28 std::string most_recent_password() { return most_recent_password_; } |
29 | 29 |
| 30 std::string most_recent_tether_network_guid() { |
| 31 return most_recent_tether_network_guid_; |
| 32 } |
| 33 |
30 // WifiHotspotConnector: | 34 // WifiHotspotConnector: |
31 void ConnectToWifiHotspot( | 35 void ConnectToWifiHotspot( |
32 const std::string& ssid, | 36 const std::string& ssid, |
33 const std::string& password, | 37 const std::string& password, |
| 38 const std::string& tether_network_guid, |
34 const WifiHotspotConnector::WifiConnectionCallback& callback) override; | 39 const WifiHotspotConnector::WifiConnectionCallback& callback) override; |
35 | 40 |
36 private: | 41 private: |
37 std::string most_recent_ssid_; | 42 std::string most_recent_ssid_; |
38 std::string most_recent_password_; | 43 std::string most_recent_password_; |
| 44 std::string most_recent_tether_network_guid_; |
39 WifiHotspotConnector::WifiConnectionCallback most_recent_callback_; | 45 WifiHotspotConnector::WifiConnectionCallback most_recent_callback_; |
40 | 46 |
41 DISALLOW_COPY_AND_ASSIGN(FakeWifiHotspotConnector); | 47 DISALLOW_COPY_AND_ASSIGN(FakeWifiHotspotConnector); |
42 }; | 48 }; |
43 | 49 |
44 } // namespace tether | 50 } // namespace tether |
45 | 51 |
46 } // namespace chromeos | 52 } // namespace chromeos |
47 | 53 |
48 #endif // CHROMEOS_COMPONENTS_TETHER_FAKE_WIFI_HOTSPOT_CONNECTOR_H_ | 54 #endif // CHROMEOS_COMPONENTS_TETHER_FAKE_WIFI_HOTSPOT_CONNECTOR_H_ |
OLD | NEW |