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

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

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
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service_factory.h
diff --git a/chrome/browser/sync/profile_sync_service_factory.h b/chrome/browser/sync/profile_sync_service_factory.h
index 31d0c4d07e8c3d31cc90175b9fe644da369adbbc..4c8c6c9e30238dbd69f69c3611a8b733a18e11f2 100644
--- a/chrome/browser/sync/profile_sync_service_factory.h
+++ b/chrome/browser/sync/profile_sync_service_factory.h
@@ -14,6 +14,7 @@ struct DefaultSingletonTraits;
}
namespace sync_driver {
+class SyncClient;
class SyncService;
}
@@ -22,6 +23,9 @@ class ProfileSyncService;
class ProfileSyncServiceFactory : public BrowserContextKeyedServiceFactory {
public:
+ typedef base::Callback<std::unique_ptr<sync_driver::SyncClient>(Profile*)>
+ SyncClientFactory;
+
static ProfileSyncService* GetForProfile(Profile* profile);
static bool HasProfileSyncService(Profile* profile);
@@ -32,6 +36,9 @@ class ProfileSyncServiceFactory : public BrowserContextKeyedServiceFactory {
static ProfileSyncServiceFactory* GetInstance();
+ // Overrides how the SyncClient is created for testing purposes.
+ static void SetSyncClientFactoryForTest(SyncClientFactory* client_factory);
+
private:
friend struct base::DefaultSingletonTraits<ProfileSyncServiceFactory>;
@@ -42,6 +49,10 @@ class ProfileSyncServiceFactory : public BrowserContextKeyedServiceFactory {
KeyedService* BuildServiceInstanceFor(
content::BrowserContext* context) const override;
+ // A factory function for overriding the way the SyncClient is created.
+ // This is a raw pointer so it can be statically initialized.
+ static SyncClientFactory* client_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceFactory);
};
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698