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 "chrome/browser/sync/test_profile_sync_service.h" | 5 #include "chrome/browser/sync/test_profile_sync_service.h" |
6 | 6 |
7 #include "chrome/browser/signin/signin_manager.h" | 7 #include "chrome/browser/signin/signin_manager.h" |
8 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" | 8 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" |
9 #include "chrome/browser/sync/glue/data_type_controller.h" | 9 #include "chrome/browser/sync/glue/data_type_controller.h" |
10 #include "chrome/browser/sync/glue/sync_backend_host.h" | 10 #include "chrome/browser/sync/glue/sync_backend_host.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 const syncer::WeakHandle<syncer::JsBackend>& backend, | 201 const syncer::WeakHandle<syncer::JsBackend>& backend, |
202 bool success) { | 202 bool success) { |
203 ProfileSyncService::OnBackendInitialized(backend, success); | 203 ProfileSyncService::OnBackendInitialized(backend, success); |
204 | 204 |
205 // TODO(akalin): Figure out a better way to do this. | 205 // TODO(akalin): Figure out a better way to do this. |
206 if (synchronous_backend_initialization_) { | 206 if (synchronous_backend_initialization_) { |
207 MessageLoop::current()->Quit(); | 207 MessageLoop::current()->Quit(); |
208 } | 208 } |
209 } | 209 } |
210 | 210 |
211 void TestProfileSyncService::Observe( | 211 void TestProfileSyncService::OnConfigureDone( |
212 int type, | 212 const browser_sync::DataTypeManager::ConfigureResult& result) { |
213 const content::NotificationSource& source, | 213 ProfileSyncService::OnConfigureDone(result); |
214 const content::NotificationDetails& details) { | 214 if (!synchronous_sync_configuration_) |
215 ProfileSyncService::Observe(type, source, details); | |
216 if (type == chrome::NOTIFICATION_SYNC_CONFIGURE_DONE && | |
217 !synchronous_sync_configuration_) { | |
218 MessageLoop::current()->Quit(); | 215 MessageLoop::current()->Quit(); |
219 } | |
220 } | 216 } |
221 | 217 |
222 UserShare* TestProfileSyncService::GetUserShare() const { | 218 UserShare* TestProfileSyncService::GetUserShare() const { |
223 return backend_->GetUserShare(); | 219 return backend_->GetUserShare(); |
224 } | 220 } |
225 | 221 |
226 void TestProfileSyncService::dont_set_initial_sync_ended_on_init() { | 222 void TestProfileSyncService::dont_set_initial_sync_ended_on_init() { |
227 set_initial_sync_ended_on_init_ = false; | 223 set_initial_sync_ended_on_init_ = false; |
228 } | 224 } |
229 void TestProfileSyncService::set_synchronous_sync_configuration() { | 225 void TestProfileSyncService::set_synchronous_sync_configuration() { |
(...skipping 12 matching lines...) Expand all Loading... |
242 profile(), | 238 profile(), |
243 sync_prefs_.AsWeakPtr(), | 239 sync_prefs_.AsWeakPtr(), |
244 invalidator_storage_.AsWeakPtr(), | 240 invalidator_storage_.AsWeakPtr(), |
245 id_factory_, | 241 id_factory_, |
246 callback_, | 242 callback_, |
247 set_initial_sync_ended_on_init_, | 243 set_initial_sync_ended_on_init_, |
248 synchronous_backend_initialization_, | 244 synchronous_backend_initialization_, |
249 fail_initial_download_, | 245 fail_initial_download_, |
250 storage_option_)); | 246 storage_option_)); |
251 } | 247 } |
OLD | NEW |