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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 class TetherConnectorTest : public NetworkStateTest { | 142 class TetherConnectorTest : public NetworkStateTest { |
143 public: | 143 public: |
144 TetherConnectorTest() | 144 TetherConnectorTest() |
145 : test_devices_(cryptauth::GenerateTestRemoteDevices(2u)) {} | 145 : test_devices_(cryptauth::GenerateTestRemoteDevices(2u)) {} |
146 ~TetherConnectorTest() override {} | 146 ~TetherConnectorTest() override {} |
147 | 147 |
148 void SetUp() override { | 148 void SetUp() override { |
149 DBusThreadManager::Initialize(); | 149 DBusThreadManager::Initialize(); |
150 NetworkStateTest::SetUp(); | 150 NetworkStateTest::SetUp(); |
151 network_state_handler()->SetTetherTechnologyState( | |
152 NetworkStateHandler::TECHNOLOGY_ENABLED); | |
153 | 151 |
154 fake_operation_factory_ = | 152 fake_operation_factory_ = |
155 base::WrapUnique(new FakeConnectTetheringOperationFactory()); | 153 base::WrapUnique(new FakeConnectTetheringOperationFactory()); |
156 ConnectTetheringOperation::Factory::SetInstanceForTesting( | 154 ConnectTetheringOperation::Factory::SetInstanceForTesting( |
157 fake_operation_factory_.get()); | 155 fake_operation_factory_.get()); |
158 | 156 |
159 test_network_connect_ = base::WrapUnique(new TestNetworkConnect()); | 157 test_network_connect_ = base::WrapUnique(new TestNetworkConnect()); |
160 fake_wifi_hotspot_connector_ = | 158 fake_wifi_hotspot_connector_ = |
161 base::MakeUnique<FakeWifiHotspotConnector>(network_state_handler()); | 159 base::MakeUnique<FakeWifiHotspotConnector>(network_state_handler()); |
162 fake_active_host_ = base::MakeUnique<FakeActiveHost>(); | 160 fake_active_host_ = base::MakeUnique<FakeActiveHost>(); |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 EXPECT_EQ(test_devices_[1].GetDeviceId(), | 469 EXPECT_EQ(test_devices_[1].GetDeviceId(), |
472 fake_active_host_->GetActiveHostDeviceId()); | 470 fake_active_host_->GetActiveHostDeviceId()); |
473 EXPECT_EQ(GetTetherNetworkGuid(test_devices_[1].GetDeviceId()), | 471 EXPECT_EQ(GetTetherNetworkGuid(test_devices_[1].GetDeviceId()), |
474 fake_active_host_->GetTetherNetworkGuid()); | 472 fake_active_host_->GetTetherNetworkGuid()); |
475 EXPECT_TRUE(fake_active_host_->GetWifiNetworkGuid().empty()); | 473 EXPECT_TRUE(fake_active_host_->GetWifiNetworkGuid().empty()); |
476 } | 474 } |
477 | 475 |
478 } // namespace tether | 476 } // namespace tether |
479 | 477 |
480 } // namespace chromeos | 478 } // namespace chromeos |
OLD | NEW |