OLD | NEW |
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 85 } |
86 | 86 |
87 using testing::Return; | 87 using testing::Return; |
88 using testing::StrictMock; | 88 using testing::StrictMock; |
89 using testing::_; | 89 using testing::_; |
90 | 90 |
91 class TestSyncServiceObserver : public syncer::SyncServiceObserver { | 91 class TestSyncServiceObserver : public syncer::SyncServiceObserver { |
92 public: | 92 public: |
93 explicit TestSyncServiceObserver(ProfileSyncService* service) | 93 explicit TestSyncServiceObserver(ProfileSyncService* service) |
94 : service_(service), setup_in_progress_(false) {} | 94 : service_(service), setup_in_progress_(false) {} |
95 void OnStateChanged() override { | 95 void OnStateChanged(syncer::SyncService* sync) override { |
96 setup_in_progress_ = service_->IsSetupInProgress(); | 96 setup_in_progress_ = service_->IsSetupInProgress(); |
97 } | 97 } |
98 bool setup_in_progress() const { return setup_in_progress_; } | 98 bool setup_in_progress() const { return setup_in_progress_; } |
99 | 99 |
100 private: | 100 private: |
101 ProfileSyncService* service_; | 101 ProfileSyncService* service_; |
102 bool setup_in_progress_; | 102 bool setup_in_progress_; |
103 }; | 103 }; |
104 | 104 |
105 // A variant of the FakeSyncEngine that won't automatically call back when asked | 105 // A variant of the FakeSyncEngine that won't automatically call back when asked |
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 // Progress the controller to RUNNING first, which is how the service | 969 // Progress the controller to RUNNING first, which is how the service |
970 // determines whether a type is enabled. | 970 // determines whether a type is enabled. |
971 controller->StartAssociating(base::Bind(&DoNothing)); | 971 controller->StartAssociating(base::Bind(&DoNothing)); |
972 controller->FinishStart(DataTypeController::OK_FIRST_RUN); | 972 controller->FinishStart(DataTypeController::OK_FIRST_RUN); |
973 service()->RegisterDataTypeController(std::move(controller)); | 973 service()->RegisterDataTypeController(std::move(controller)); |
974 EXPECT_NE(nullptr, service()->GetOpenTabsUIDelegate()); | 974 EXPECT_NE(nullptr, service()->GetOpenTabsUIDelegate()); |
975 } | 975 } |
976 | 976 |
977 } // namespace | 977 } // namespace |
978 } // namespace browser_sync | 978 } // namespace browser_sync |
OLD | NEW |