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

Side by Side Diff: components/ukm/observers/sync_disable_observer_unittest.cc

Issue 2910773003: [Sync] Replace manual DI with SetTestingFactory. (Closed)
Patch Set: Created 3 years, 7 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 | « components/sync/driver/sync_service.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/ukm/observers/sync_disable_observer.h" 5 #include "components/ukm/observers/sync_disable_observer.h"
6 6
7 #include "base/observer_list.h" 7 #include "base/observer_list.h"
8 #include "components/sync/driver/fake_sync_service.h" 8 #include "components/sync/driver/fake_sync_service.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 10 matching lines...) Expand all
21 initialized_ = true; 21 initialized_ = true;
22 has_passphrase_ = has_passphrase; 22 has_passphrase_ = has_passphrase;
23 preferred_data_types_ = 23 preferred_data_types_ =
24 enabled ? syncer::ModelTypeSet(syncer::HISTORY_DELETE_DIRECTIVES) 24 enabled ? syncer::ModelTypeSet(syncer::HISTORY_DELETE_DIRECTIVES)
25 : syncer::ModelTypeSet(); 25 : syncer::ModelTypeSet();
26 for (auto& observer : observers_) { 26 for (auto& observer : observers_) {
27 observer.OnStateChanged(this); 27 observer.OnStateChanged(this);
28 } 28 }
29 } 29 }
30 30
31 void Shutdown() { 31 void Shutdown() override {
32 for (auto& observer : observers_) { 32 for (auto& observer : observers_) {
33 observer.OnSyncShutdown(this); 33 observer.OnSyncShutdown(this);
34 } 34 }
35 } 35 }
36 36
37 private: 37 private:
38 // syncer::FakeSyncService: 38 // syncer::FakeSyncService:
39 void AddObserver(syncer::SyncServiceObserver* observer) override { 39 void AddObserver(syncer::SyncServiceObserver* observer) override {
40 observers_.AddObserver(observer); 40 observers_.AddObserver(observer);
41 } 41 }
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 EXPECT_FALSE(observer.IsHistorySyncEnabledOnAllProfiles()); 207 EXPECT_FALSE(observer.IsHistorySyncEnabledOnAllProfiles());
208 EXPECT_TRUE(observer.ResetNotified()); 208 EXPECT_TRUE(observer.ResetNotified());
209 EXPECT_TRUE(observer.ResetPurged()); 209 EXPECT_TRUE(observer.ResetPurged());
210 sync.Shutdown(); 210 sync.Shutdown();
211 EXPECT_FALSE(observer.IsHistorySyncEnabledOnAllProfiles()); 211 EXPECT_FALSE(observer.IsHistorySyncEnabledOnAllProfiles());
212 EXPECT_FALSE(observer.ResetNotified()); 212 EXPECT_FALSE(observer.ResetNotified());
213 EXPECT_FALSE(observer.ResetPurged()); 213 EXPECT_FALSE(observer.ResetPurged());
214 } 214 }
215 215
216 } // namespace ukm 216 } // namespace ukm
OLDNEW
« no previous file with comments | « components/sync/driver/sync_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698