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

Side by Side Diff: components/browser_sync/profile_sync_service_unittest.cc

Issue 2657673004: Add shutdown notification and service refs to SyncServiceObserver. (Closed)
Patch Set: Use parameter Created 3 years, 10 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser_sync/profile_sync_service.h" 5 #include "components/browser_sync/profile_sync_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 83
84 using testing::Return; 84 using testing::Return;
85 using testing::StrictMock; 85 using testing::StrictMock;
86 using testing::_; 86 using testing::_;
87 87
88 class TestSyncServiceObserver : public syncer::SyncServiceObserver { 88 class TestSyncServiceObserver : public syncer::SyncServiceObserver {
89 public: 89 public:
90 explicit TestSyncServiceObserver(ProfileSyncService* service) 90 explicit TestSyncServiceObserver(ProfileSyncService* service)
91 : service_(service), setup_in_progress_(false) {} 91 : service_(service), setup_in_progress_(false) {}
92 void OnStateChanged() override { 92 void OnStateChanged(syncer::SyncService sync) override {
93 setup_in_progress_ = service_->IsSetupInProgress(); 93 setup_in_progress_ = service_->IsSetupInProgress();
94 } 94 }
95 bool setup_in_progress() const { return setup_in_progress_; } 95 bool setup_in_progress() const { return setup_in_progress_; }
96 96
97 private: 97 private:
98 ProfileSyncService* service_; 98 ProfileSyncService* service_;
99 bool setup_in_progress_; 99 bool setup_in_progress_;
100 }; 100 };
101 101
102 // A variant of the FakeSyncEngine that won't automatically call back when asked 102 // A variant of the FakeSyncEngine that won't automatically call back when asked
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 // Progress the controller to RUNNING first, which is how the service 955 // Progress the controller to RUNNING first, which is how the service
956 // determines whether a type is enabled. 956 // determines whether a type is enabled.
957 controller->StartAssociating(base::Bind(&DoNothing)); 957 controller->StartAssociating(base::Bind(&DoNothing));
958 controller->FinishStart(DataTypeController::OK_FIRST_RUN); 958 controller->FinishStart(DataTypeController::OK_FIRST_RUN);
959 service()->RegisterDataTypeController(std::move(controller)); 959 service()->RegisterDataTypeController(std::move(controller));
960 EXPECT_NE(nullptr, service()->GetOpenTabsUIDelegate()); 960 EXPECT_NE(nullptr, service()->GetOpenTabsUIDelegate());
961 } 961 }
962 962
963 } // namespace 963 } // namespace
964 } // namespace browser_sync 964 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698