| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/sync/abstract_profile_sync_service_test.h" | 7 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" |
| 8 #include "chrome/browser/sync/engine/syncapi.h" | 8 #include "chrome/browser/sync/engine/syncapi.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" |
| 11 #include "chrome/browser/sync/profile_sync_factory.h" | 11 #include "chrome/browser/sync/profile_sync_factory.h" |
| 12 #include "chrome/browser/sync/sessions/session_state.h" | 12 #include "chrome/browser/sync/sessions/session_state.h" |
| 13 #include "chrome/browser/sync/syncable/directory_manager.h" | 13 #include "chrome/browser/sync/syncable/directory_manager.h" |
| 14 #include "chrome/browser/sync/syncable/syncable.h" | 14 #include "chrome/browser/sync/syncable/syncable.h" |
| 15 #include "chrome/common/chrome_notification_types.h" |
| 15 #include "chrome/test/sync/test_http_bridge_factory.h" | 16 #include "chrome/test/sync/test_http_bridge_factory.h" |
| 16 | 17 |
| 17 using browser_sync::ModelSafeRoutingInfo; | 18 using browser_sync::ModelSafeRoutingInfo; |
| 18 using browser_sync::sessions::ErrorCounters; | 19 using browser_sync::sessions::ErrorCounters; |
| 19 using browser_sync::sessions::SyncSourceInfo; | 20 using browser_sync::sessions::SyncSourceInfo; |
| 20 using browser_sync::sessions::SyncerStatus; | 21 using browser_sync::sessions::SyncerStatus; |
| 21 using browser_sync::sessions::SyncSessionSnapshot; | 22 using browser_sync::sessions::SyncSessionSnapshot; |
| 22 using syncable::DirectoryManager; | 23 using syncable::DirectoryManager; |
| 23 using syncable::ModelType; | 24 using syncable::ModelType; |
| 24 using syncable::ScopedDirLookup; | 25 using syncable::ScopedDirLookup; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 ProfileSyncService::OnBackendInitialized(); | 239 ProfileSyncService::OnBackendInitialized(); |
| 239 if (send_passphrase_required) | 240 if (send_passphrase_required) |
| 240 OnPassphraseRequired(sync_api::REASON_DECRYPTION); | 241 OnPassphraseRequired(sync_api::REASON_DECRYPTION); |
| 241 | 242 |
| 242 // TODO(akalin): Figure out a better way to do this. | 243 // TODO(akalin): Figure out a better way to do this. |
| 243 if (synchronous_backend_initialization_) { | 244 if (synchronous_backend_initialization_) { |
| 244 MessageLoop::current()->Quit(); | 245 MessageLoop::current()->Quit(); |
| 245 } | 246 } |
| 246 } | 247 } |
| 247 | 248 |
| 248 void TestProfileSyncService::Observe(NotificationType type, | 249 void TestProfileSyncService::Observe(int type, |
| 249 const NotificationSource& source, | 250 const NotificationSource& source, |
| 250 const NotificationDetails& details) { | 251 const NotificationDetails& details) { |
| 251 ProfileSyncService::Observe(type, source, details); | 252 ProfileSyncService::Observe(type, source, details); |
| 252 if (type == NotificationType::SYNC_CONFIGURE_DONE && | 253 if (type == chrome::NOTIFICATION_SYNC_CONFIGURE_DONE && |
| 253 !synchronous_sync_configuration_) { | 254 !synchronous_sync_configuration_) { |
| 254 MessageLoop::current()->Quit(); | 255 MessageLoop::current()->Quit(); |
| 255 } | 256 } |
| 256 } | 257 } |
| 257 | 258 |
| 258 void TestProfileSyncService::dont_set_initial_sync_ended_on_init() { | 259 void TestProfileSyncService::dont_set_initial_sync_ended_on_init() { |
| 259 set_initial_sync_ended_on_init_ = false; | 260 set_initial_sync_ended_on_init_ = false; |
| 260 } | 261 } |
| 261 void TestProfileSyncService::set_synchronous_sync_configuration() { | 262 void TestProfileSyncService::set_synchronous_sync_configuration() { |
| 262 synchronous_sync_configuration_ = true; | 263 synchronous_sync_configuration_ = true; |
| 263 } | 264 } |
| 264 | 265 |
| 265 void TestProfileSyncService::CreateBackend() { | 266 void TestProfileSyncService::CreateBackend() { |
| 266 backend_.reset(new browser_sync::SyncBackendHostForProfileSyncTest( | 267 backend_.reset(new browser_sync::SyncBackendHostForProfileSyncTest( |
| 267 profile(), | 268 profile(), |
| 268 set_initial_sync_ended_on_init_, | 269 set_initial_sync_ended_on_init_, |
| 269 synchronous_backend_initialization_)); | 270 synchronous_backend_initialization_)); |
| 270 } | 271 } |
| 271 | 272 |
| 272 std::string TestProfileSyncService::GetLsidForAuthBootstraping() { | 273 std::string TestProfileSyncService::GetLsidForAuthBootstraping() { |
| 273 return "foo"; | 274 return "foo"; |
| 274 } | 275 } |
| OLD | NEW |