| 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 #include "chromeos/components/tether/fake_wifi_hotspot_connector.h" | 5 #include "chromeos/components/tether/fake_wifi_hotspot_connector.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "chromeos/network/network_state_handler.h" | 8 #include "chromeos/network/network_state_handler.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| 11 namespace chromeos { | 11 namespace chromeos { |
| 12 | 12 |
| 13 namespace tether { | 13 namespace tether { |
| 14 | 14 |
| 15 FakeWifiHotspotConnector::FakeWifiHotspotConnector( | 15 FakeWifiHotspotConnector::FakeWifiHotspotConnector( |
| 16 NetworkStateHandler* network_state_handler) | 16 NetworkStateHandler* network_state_handler) |
| 17 : WifiHotspotConnector(network_state_handler, nullptr) {} | 17 : WifiHotspotConnector(network_state_handler, |
| 18 nullptr /* network_connect */) {} |
| 18 | 19 |
| 19 FakeWifiHotspotConnector::~FakeWifiHotspotConnector() {} | 20 FakeWifiHotspotConnector::~FakeWifiHotspotConnector() {} |
| 20 | 21 |
| 21 void FakeWifiHotspotConnector::CallMostRecentCallback( | 22 void FakeWifiHotspotConnector::CallMostRecentCallback( |
| 22 const std::string& wifi_guid) { | 23 const std::string& wifi_guid) { |
| 23 EXPECT_FALSE(most_recent_callback_.is_null()); | 24 EXPECT_FALSE(most_recent_callback_.is_null()); |
| 24 most_recent_callback_.Run(wifi_guid); | 25 most_recent_callback_.Run(wifi_guid); |
| 25 } | 26 } |
| 26 | 27 |
| 27 void FakeWifiHotspotConnector::ConnectToWifiHotspot( | 28 void FakeWifiHotspotConnector::ConnectToWifiHotspot( |
| 28 const std::string& ssid, | 29 const std::string& ssid, |
| 29 const std::string& password, | 30 const std::string& password, |
| 31 const std::string& tether_network_guid, |
| 30 const WifiHotspotConnector::WifiConnectionCallback& callback) { | 32 const WifiHotspotConnector::WifiConnectionCallback& callback) { |
| 31 most_recent_ssid_ = ssid; | 33 most_recent_ssid_ = ssid; |
| 32 most_recent_password_ = password; | 34 most_recent_password_ = password; |
| 35 most_recent_tether_network_guid_ = tether_network_guid; |
| 33 most_recent_callback_ = callback; | 36 most_recent_callback_ = callback; |
| 34 } | 37 } |
| 35 | 38 |
| 36 } // namespace tether | 39 } // namespace tether |
| 37 | 40 |
| 38 } // namespace chromeos | 41 } // namespace chromeos |
| OLD | NEW |