| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/tether_connector.h" | 5 #include "chromeos/components/tether/tether_connector.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "chromeos/components/tether/connect_tethering_operation.h" | 9 #include "chromeos/components/tether/connect_tethering_operation.h" |
| 10 #include "chromeos/components/tether/device_id_tether_network_guid_map.h" | 10 #include "chromeos/components/tether/device_id_tether_network_guid_map.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 TestNetworkConnectionHandler() : NetworkConnectionHandler() {} | 53 TestNetworkConnectionHandler() : NetworkConnectionHandler() {} |
| 54 ~TestNetworkConnectionHandler() override {} | 54 ~TestNetworkConnectionHandler() override {} |
| 55 | 55 |
| 56 void CallTetherDelegate( | 56 void CallTetherDelegate( |
| 57 const std::string& tether_network_guid, | 57 const std::string& tether_network_guid, |
| 58 const base::Closure& success_callback, | 58 const base::Closure& success_callback, |
| 59 const network_handler::ErrorCallback& error_callback) { | 59 const network_handler::ErrorCallback& error_callback) { |
| 60 InitiateTetherNetworkConnection(tether_network_guid, success_callback, | 60 InitiateTetherNetworkConnection(tether_network_guid, success_callback, |
| 61 error_callback); | 61 error_callback); |
| 62 } | 62 } |
| 63 |
| 64 // NetworkConnectionHandler: |
| 65 void ConnectToNetwork(const std::string& service_path, |
| 66 const base::Closure& success_callback, |
| 67 const network_handler::ErrorCallback& error_callback, |
| 68 bool check_error_state) override {} |
| 69 |
| 70 void DisconnectNetwork( |
| 71 const std::string& service_path, |
| 72 const base::Closure& success_callback, |
| 73 const network_handler::ErrorCallback& error_callback) override {} |
| 74 |
| 75 bool HasConnectingNetwork(const std::string& service_path) override { |
| 76 return false; |
| 77 } |
| 78 |
| 79 bool HasPendingConnectRequest() override { return false; } |
| 80 |
| 81 void Init(NetworkStateHandler* network_state_handler, |
| 82 NetworkConfigurationHandler* network_configuration_handler, |
| 83 ManagedNetworkConfigurationHandler* |
| 84 managed_network_configuration_handler) override {} |
| 63 }; | 85 }; |
| 64 | 86 |
| 65 class FakeConnectTetheringOperation : public ConnectTetheringOperation { | 87 class FakeConnectTetheringOperation : public ConnectTetheringOperation { |
| 66 public: | 88 public: |
| 67 FakeConnectTetheringOperation( | 89 FakeConnectTetheringOperation( |
| 68 const cryptauth::RemoteDevice& device_to_connect, | 90 const cryptauth::RemoteDevice& device_to_connect, |
| 69 BleConnectionManager* connection_manager, | 91 BleConnectionManager* connection_manager, |
| 70 TetherHostResponseRecorder* tether_host_response_recorder) | 92 TetherHostResponseRecorder* tether_host_response_recorder) |
| 71 : ConnectTetheringOperation(device_to_connect, | 93 : ConnectTetheringOperation(device_to_connect, |
| 72 connection_manager, | 94 connection_manager, |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 EXPECT_EQ(test_devices_[1].GetDeviceId(), | 500 EXPECT_EQ(test_devices_[1].GetDeviceId(), |
| 479 fake_active_host_->GetActiveHostDeviceId()); | 501 fake_active_host_->GetActiveHostDeviceId()); |
| 480 EXPECT_EQ(GetTetherNetworkGuid(test_devices_[1].GetDeviceId()), | 502 EXPECT_EQ(GetTetherNetworkGuid(test_devices_[1].GetDeviceId()), |
| 481 fake_active_host_->GetTetherNetworkGuid()); | 503 fake_active_host_->GetTetherNetworkGuid()); |
| 482 EXPECT_TRUE(fake_active_host_->GetWifiNetworkGuid().empty()); | 504 EXPECT_TRUE(fake_active_host_->GetWifiNetworkGuid().empty()); |
| 483 } | 505 } |
| 484 | 506 |
| 485 } // namespace tether | 507 } // namespace tether |
| 486 | 508 |
| 487 } // namespace chromeos | 509 } // namespace chromeos |
| OLD | NEW |