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

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

Issue 1421003007: [Sync] Componentize ProfileSyncComponentsFactoryImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix browser_tests Created 5 years, 1 month 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_startup_unittest.cc
diff --git a/chrome/browser/sync/profile_sync_service_startup_unittest.cc b/chrome/browser/sync/profile_sync_service_startup_unittest.cc
index 4d4fbe6de8343a374303979ab8a7b48ae92e8b34..3813a82c4dc4a9559e7ed1e9cd0c57d5ea46bcce 100644
--- a/chrome/browser/sync/profile_sync_service_startup_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_startup_unittest.cc
@@ -98,7 +98,10 @@ class TestProfileSyncServiceNoBackup : public ProfileSyncService {
content::BrowserThread::DB),
content::BrowserThread::GetMessageLoopProxyForThread(
content::BrowserThread::FILE),
- content::BrowserThread::GetBlockingPool()) {}
+ content::BrowserThread::GetBlockingPool()) {
+ GetSyncClient()->Initialize(
+ make_scoped_ptr(new SyncApiComponentFactoryMock()), this);
+ }
protected:
bool NeedBackup() const override { return false; }
@@ -140,8 +143,7 @@ class ProfileSyncServiceStartupTest : public testing::Test {
content::BrowserContext* browser_context) {
Profile* profile = static_cast<Profile*>(browser_context);
scoped_ptr<browser_sync::ChromeSyncClient> sync_client(
- new browser_sync::ChromeSyncClient(
- profile, make_scoped_ptr(new SyncApiComponentFactoryMock())));
+ new browser_sync::ChromeSyncClient(profile));
return make_scoped_ptr(new TestProfileSyncServiceNoBackup(
sync_client.Pass(), profile,
make_scoped_ptr(new SigninManagerWrapper(
@@ -212,7 +214,7 @@ class ProfileSyncServiceStartupTest : public testing::Test {
browser_sync::SyncBackendHostMock* sync_backend_host =
new browser_sync::SyncBackendHostMock();
EXPECT_CALL(*GetSyncApiComponentFactoryMock(),
- CreateSyncBackendHost(_, _, _, _, _))
+ CreateSyncBackendHost(_, _, _, _))
.WillOnce(Return(sync_backend_host));
return sync_backend_host;
}
@@ -246,8 +248,7 @@ class ProfileSyncServiceStartupCrosTest : public ProfileSyncServiceStartupTest {
ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
EXPECT_TRUE(signin->IsAuthenticated());
scoped_ptr<browser_sync::ChromeSyncClient> sync_client(
- new browser_sync::ChromeSyncClient(
- profile, make_scoped_ptr(new SyncApiComponentFactoryMock())));
+ new browser_sync::ChromeSyncClient(profile));
return make_scoped_ptr(new TestProfileSyncServiceNoBackup(
sync_client.Pass(), profile,
make_scoped_ptr(new SigninManagerWrapper(signin)), oauth2_token_service,
@@ -385,7 +386,7 @@ TEST_F(ProfileSyncServiceStartupCrosTest, MAYBE_StartCrosNoCredentials) {
CreateDataTypeManager(_, _, _, _, _))
.Times(0);
EXPECT_CALL(*GetSyncApiComponentFactoryMock(),
- CreateSyncBackendHost(_, _, _, _, _))
+ CreateSyncBackendHost(_, _, _, _))
.Times(0);
profile_->GetPrefs()->ClearPref(sync_driver::prefs::kSyncHasSetupCompleted);
EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber());

Powered by Google App Engine
This is Rietveld 408576698