Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1033)

Side by Side Diff: chromeos/components/tether/tether_connector_unittest.cc

Issue 2819993002: [CrOS Tether] Add the notion of a tether DeviceState. (Closed)
Patch Set: hansberry@ comments. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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);
151 153
152 fake_operation_factory_ = 154 fake_operation_factory_ =
153 base::WrapUnique(new FakeConnectTetheringOperationFactory()); 155 base::WrapUnique(new FakeConnectTetheringOperationFactory());
154 ConnectTetheringOperation::Factory::SetInstanceForTesting( 156 ConnectTetheringOperation::Factory::SetInstanceForTesting(
155 fake_operation_factory_.get()); 157 fake_operation_factory_.get());
156 158
157 test_network_connect_ = base::WrapUnique(new TestNetworkConnect()); 159 test_network_connect_ = base::WrapUnique(new TestNetworkConnect());
158 fake_wifi_hotspot_connector_ = 160 fake_wifi_hotspot_connector_ =
159 base::MakeUnique<FakeWifiHotspotConnector>(network_state_handler()); 161 base::MakeUnique<FakeWifiHotspotConnector>(network_state_handler());
160 fake_active_host_ = base::MakeUnique<FakeActiveHost>(); 162 fake_active_host_ = base::MakeUnique<FakeActiveHost>();
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 EXPECT_EQ(test_devices_[1].GetDeviceId(), 471 EXPECT_EQ(test_devices_[1].GetDeviceId(),
470 fake_active_host_->GetActiveHostDeviceId()); 472 fake_active_host_->GetActiveHostDeviceId());
471 EXPECT_EQ(GetTetherNetworkGuid(test_devices_[1].GetDeviceId()), 473 EXPECT_EQ(GetTetherNetworkGuid(test_devices_[1].GetDeviceId()),
472 fake_active_host_->GetTetherNetworkGuid()); 474 fake_active_host_->GetTetherNetworkGuid());
473 EXPECT_TRUE(fake_active_host_->GetWifiNetworkGuid().empty()); 475 EXPECT_TRUE(fake_active_host_->GetWifiNetworkGuid().empty());
474 } 476 }
475 477
476 } // namespace tether 478 } // namespace tether
477 479
478 } // namespace chromeos 480 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698