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

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

Issue 2328393002: [Sync] Add a sanity integration test for USS. (Closed)
Patch Set: Rebase. Created 4 years, 3 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/profile_sync_service_factory.cc
diff --git a/chrome/browser/sync/profile_sync_service_factory.cc b/chrome/browser/sync/profile_sync_service_factory.cc
index 2c0ae010c6dbad6b892f1141c8fb1f78a2fb486c..a4322a7770465bb460a44197f77e7c422f2ca8cb 100644
--- a/chrome/browser/sync/profile_sync_service_factory.cc
+++ b/chrome/browser/sync/profile_sync_service_factory.cc
@@ -170,8 +170,12 @@ KeyedService* ProfileSyncServiceFactory::BuildServiceInstanceFor(
? ProfileSyncService::AUTO_START
: ProfileSyncService::MANUAL_START;
- init_params.sync_client =
- base::MakeUnique<browser_sync::ChromeSyncClient>(profile);
+ if (!client_factory_) {
+ init_params.sync_client =
+ base::MakeUnique<browser_sync::ChromeSyncClient>(profile);
+ } else {
+ init_params.sync_client = client_factory_->Run(profile);
+ }
init_params.network_time_update_callback = base::Bind(&UpdateNetworkTime);
init_params.base_directory = profile->GetPath();
@@ -196,3 +200,13 @@ KeyedService* ProfileSyncServiceFactory::BuildServiceInstanceFor(
bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) {
return GetInstance()->GetServiceForBrowserContext(profile, false) != NULL;
}
+
+// static
+void ProfileSyncServiceFactory::SetSyncClientFactoryForTest(
+ SyncClientFactory* client_factory) {
+ client_factory_ = client_factory;
+}
+
+// static
+ProfileSyncServiceFactory::SyncClientFactory*
+ ProfileSyncServiceFactory::client_factory_ = nullptr;

Powered by Google App Engine
This is Rietveld 408576698