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

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

Issue 2781263004: HostScanner: Add scanned hosts to NetworkStateHandler and NotificationPresenter. (Closed)
Patch Set: Address nits. 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
« no previous file with comments | « no previous file | chromeos/components/tether/host_scanner.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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), num_scans_started_(0) {} 85 : HostScanner(nullptr, nullptr, nullptr, nullptr, nullptr),
86 num_scans_started_(0) {}
86 ~FakeHostScanner() override {} 87 ~FakeHostScanner() override {}
87 88
88 void StartScan() override { num_scans_started_++; } 89 void StartScan() override { num_scans_started_++; }
89 90
90 int num_scans_started() { return num_scans_started_; } 91 int num_scans_started() { return num_scans_started_; }
91 92
92 private: 93 private:
93 int num_scans_started_; 94 int num_scans_started_;
94 }; 95 };
95 96
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 test_delegate_->set_are_tether_hosts_synced(false); 221 test_delegate_->set_are_tether_hosts_synced(false);
221 host_scan_scheduler_->OnSyncFinished( 222 host_scan_scheduler_->OnSyncFinished(
222 cryptauth::CryptAuthDeviceManager::SyncResult::SUCCESS, 223 cryptauth::CryptAuthDeviceManager::SyncResult::SUCCESS,
223 cryptauth::CryptAuthDeviceManager::DeviceChangeResult::UNCHANGED); 224 cryptauth::CryptAuthDeviceManager::DeviceChangeResult::UNCHANGED);
224 EXPECT_EQ(1, fake_host_scanner_->num_scans_started()); 225 EXPECT_EQ(1, fake_host_scanner_->num_scans_started());
225 } 226 }
226 227
227 } // namespace tether 228 } // namespace tether
228 229
229 } // namespace chromeos 230 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chromeos/components/tether/host_scanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698