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

Unified Diff: chrome/browser/sync/test_profile_sync_service.cc

Issue 6380004: [Sync] Tidy up SyncBackendHost interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows compile Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/test_profile_sync_service.cc
diff --git a/chrome/browser/sync/test_profile_sync_service.cc b/chrome/browser/sync/test_profile_sync_service.cc
index d93e63b6cf5e8cb7a08e3131c4b40475f5330029..bab5d7dc968f8a2830305aa89012e4debda5cf10 100644
--- a/chrome/browser/sync/test_profile_sync_service.cc
+++ b/chrome/browser/sync/test_profile_sync_service.cc
@@ -11,15 +11,12 @@ namespace browser_sync {
SyncBackendHostForProfileSyncTest::SyncBackendHostForProfileSyncTest(
TestProfileSyncService* service,
Profile* profile,
- const FilePath& profile_path,
- const DataTypeController::TypeMap& data_type_controllers,
Task* initial_condition_setup_task,
int num_expected_resumes,
int num_expected_pauses,
bool set_initial_sync_ended_on_init,
bool synchronous_init)
- : browser_sync::SyncBackendHost(service, profile, profile_path,
- data_type_controllers),
+ : browser_sync::SyncBackendHost(service, profile),
initial_condition_setup_task_(initial_condition_setup_task),
set_initial_sync_ended_on_init_(set_initial_sync_ended_on_init),
synchronous_init_(synchronous_init),
@@ -44,35 +41,43 @@ SyncBackendHostForProfileSyncTest::SyncBackendHostForProfileSyncTest(
}
void
-SyncBackendHostForProfileSyncTest::HandleInitializationCompletedOnFrontendLoop() {
- set_syncapi_initialized(); // Need to do this asap so task below works.
+SyncBackendHostForProfileSyncTest::
+ HandleInitializationCompletedOnFrontendLoop() {
tim (not reviewing) 2011/01/19 20:42:53 hmm.. I thought the consensus for this was to not
+ set_syncapi_initialized(); // Need to do this asap so task below works.
- // Set up any nodes the test wants around before model association.
- if (initial_condition_setup_task_) {
- initial_condition_setup_task_->Run();
- }
-
- // Pretend we downloaded initial updates and set initial sync ended bits
- // if we were asked to.
- if (set_initial_sync_ended_on_init_) {
- UserShare* user_share = core_->syncapi()->GetUserShare();
- DirectoryManager* dir_manager = user_share->dir_manager.get();
+ // Set up any nodes the test wants around before model association.
+ if (initial_condition_setup_task_) {
+ initial_condition_setup_task_->Run();
+ }
- ScopedDirLookup dir(dir_manager, user_share->name);
- if (!dir.good())
- FAIL();
+ // Pretend we downloaded initial updates and set initial sync ended bits
+ // if we were asked to.
+ if (set_initial_sync_ended_on_init_) {
+ UserShare* user_share = core_->syncapi()->GetUserShare();
+ DirectoryManager* dir_manager = user_share->dir_manager.get();
- if (!dir->initial_sync_ended_for_type(syncable::NIGORI)) {
- ProfileSyncServiceTestHelper::CreateRoot(
- syncable::NIGORI, test_service_, test_service_->id_factory());
- }
+ ScopedDirLookup dir(dir_manager, user_share->name);
+ if (!dir.good())
+ FAIL();
- SetInitialSyncEndedForEnabledTypes();
+ if (!dir->initial_sync_ended_for_type(syncable::NIGORI)) {
+ ProfileSyncServiceTestHelper::CreateRoot(
+ syncable::NIGORI, test_service_, test_service_->id_factory());
}
- SyncBackendHost::HandleInitializationCompletedOnFrontendLoop();
+ SetInitialSyncEndedForEnabledTypes();
}
+ SyncBackendHost::HandleInitializationCompletedOnFrontendLoop();
+}
+} // namespace browser_sync
-} // namespace
+void TestProfileSyncService::CreateBackend() {
+ backend_.reset(new browser_sync::SyncBackendHostForProfileSyncTest(
+ this, profile(),
+ initial_condition_setup_task_.release(),
+ num_expected_resumes_, num_expected_pauses_,
+ set_initial_sync_ended_on_init_,
+ synchronous_backend_initialization_));
+}

Powered by Google App Engine
This is Rietveld 408576698