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_scan_scheduler.h" | 5 #include "chromeos/components/tether/host_scan_scheduler.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "chromeos/components/tether/host_scanner.h" | 8 #include "chromeos/components/tether/host_scanner.h" |
9 #include "chromeos/dbus/power_manager_client.h" | 9 #include "chromeos/dbus/power_manager_client.h" |
10 #include "chromeos/login/login_state.h" | 10 #include "chromeos/login/login_state.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 HostScanScheduler* observer_; | 76 HostScanScheduler* observer_; |
77 bool is_authenticated_user_logged_in; | 77 bool is_authenticated_user_logged_in; |
78 bool is_network_connected_or_connecting; | 78 bool is_network_connected_or_connecting; |
79 bool are_tether_hosts_synced; | 79 bool are_tether_hosts_synced; |
80 }; | 80 }; |
81 | 81 |
82 class FakeHostScanner : public HostScanner { | 82 class FakeHostScanner : public HostScanner { |
83 public: | 83 public: |
84 FakeHostScanner() | 84 FakeHostScanner() |
85 : HostScanner(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr), | 85 : HostScanner(nullptr, |
| 86 nullptr, |
| 87 nullptr, |
| 88 nullptr, |
| 89 nullptr, |
| 90 nullptr, |
| 91 nullptr), |
86 num_scans_started_(0) {} | 92 num_scans_started_(0) {} |
87 ~FakeHostScanner() override {} | 93 ~FakeHostScanner() override {} |
88 | 94 |
89 void StartScan() override { num_scans_started_++; } | 95 void StartScan() override { num_scans_started_++; } |
90 | 96 |
91 int num_scans_started() { return num_scans_started_; } | 97 int num_scans_started() { return num_scans_started_; } |
92 | 98 |
93 private: | 99 private: |
94 int num_scans_started_; | 100 int num_scans_started_; |
95 }; | 101 }; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 test_delegate_->set_are_tether_hosts_synced(false); | 227 test_delegate_->set_are_tether_hosts_synced(false); |
222 host_scan_scheduler_->OnSyncFinished( | 228 host_scan_scheduler_->OnSyncFinished( |
223 cryptauth::CryptAuthDeviceManager::SyncResult::SUCCESS, | 229 cryptauth::CryptAuthDeviceManager::SyncResult::SUCCESS, |
224 cryptauth::CryptAuthDeviceManager::DeviceChangeResult::UNCHANGED); | 230 cryptauth::CryptAuthDeviceManager::DeviceChangeResult::UNCHANGED); |
225 EXPECT_EQ(1, fake_host_scanner_->num_scans_started()); | 231 EXPECT_EQ(1, fake_host_scanner_->num_scans_started()); |
226 } | 232 } |
227 | 233 |
228 } // namespace tether | 234 } // namespace tether |
229 | 235 |
230 } // namespace chromeos | 236 } // namespace chromeos |
OLD | NEW |