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/host_scanner.h" | 5 #include "chromeos/components/tether/host_scanner.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 class HostScannerTest : public NetworkStateTest { | 132 class HostScannerTest : public NetworkStateTest { |
133 protected: | 133 protected: |
134 HostScannerTest() | 134 HostScannerTest() |
135 : test_devices_(cryptauth::GenerateTestRemoteDevices(4)), | 135 : test_devices_(cryptauth::GenerateTestRemoteDevices(4)), |
136 test_scanned_device_infos(CreateFakeScannedDeviceInfos(test_devices_)) { | 136 test_scanned_device_infos(CreateFakeScannedDeviceInfos(test_devices_)) { |
137 } | 137 } |
138 | 138 |
139 void SetUp() override { | 139 void SetUp() override { |
140 DBusThreadManager::Initialize(); | 140 DBusThreadManager::Initialize(); |
141 NetworkStateTest::SetUp(); | 141 NetworkStateTest::SetUp(); |
142 network_state_handler()->SetTetherTechnologyState( | |
143 NetworkStateHandler::TECHNOLOGY_ENABLED); | |
144 | 142 |
145 scanned_device_infos_so_far_.clear(); | 143 scanned_device_infos_so_far_.clear(); |
146 | 144 |
147 fake_tether_host_fetcher_ = base::MakeUnique<FakeTetherHostFetcher>( | 145 fake_tether_host_fetcher_ = base::MakeUnique<FakeTetherHostFetcher>( |
148 test_devices_, false /* synchronously_reply_with_results */); | 146 test_devices_, false /* synchronously_reply_with_results */); |
149 fake_ble_connection_manager_ = base::MakeUnique<FakeBleConnectionManager>(); | 147 fake_ble_connection_manager_ = base::MakeUnique<FakeBleConnectionManager>(); |
150 fake_host_scan_device_prioritizer_ = | 148 fake_host_scan_device_prioritizer_ = |
151 base::MakeUnique<FakeHostScanDevicePrioritizer>(); | 149 base::MakeUnique<FakeHostScanDevicePrioritizer>(); |
152 fake_notification_presenter_ = | 150 fake_notification_presenter_ = |
153 base::MakeUnique<FakeNotificationPresenter>(); | 151 base::MakeUnique<FakeNotificationPresenter>(); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 ->SendScannedDeviceListUpdate(scanned_device_infos_so_far_, | 358 ->SendScannedDeviceListUpdate(scanned_device_infos_so_far_, |
361 true /* is_final_scan_result */); | 359 true /* is_final_scan_result */); |
362 EXPECT_EQ(scanned_device_infos_so_far_, | 360 EXPECT_EQ(scanned_device_infos_so_far_, |
363 host_scanner_->most_recent_scan_results()); | 361 host_scanner_->most_recent_scan_results()); |
364 EXPECT_FALSE(host_scanner_->IsScanActive()); | 362 EXPECT_FALSE(host_scanner_->IsScanActive()); |
365 } | 363 } |
366 | 364 |
367 } // namespace tether | 365 } // namespace tether |
368 | 366 |
369 } // namespace chromeos | 367 } // namespace chromeos |
OLD | NEW |