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

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 sessions api test 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 03160fd3b563efdbd5ca7cec458a0a12b8293804..7c3afc815fb9d6585df6d76640eb5036bbcb2f4f 100644
--- a/chrome/browser/sync/profile_sync_service_startup_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_startup_unittest.cc
@@ -118,20 +118,19 @@ class ProfileSyncServiceStartupTest : public testing::Test {
void SetUp() override {
CHECK(profile_manager_.SetUp());
- TestingProfile::TestingFactories testing_facotries;
- testing_facotries.push_back(std::make_pair(
+ TestingProfile::TestingFactories testing_factories;
+ testing_factories.push_back(std::make_pair(
SigninManagerFactory::GetInstance(), BuildFakeSigninManagerBase));
- testing_facotries.push_back(
- std::make_pair(ProfileOAuth2TokenServiceFactory::GetInstance(),
- BuildAutoIssuingFakeProfileOAuth2TokenService));
- testing_facotries.push_back(
- std::make_pair(ProfileSyncServiceFactory::GetInstance(),
- BuildService));
+ testing_factories.push_back(
+ std::make_pair(ProfileOAuth2TokenServiceFactory::GetInstance(),
+ BuildAutoIssuingFakeProfileOAuth2TokenService));
+ testing_factories.push_back(
+ std::make_pair(ProfileSyncServiceFactory::GetInstance(), BuildService));
profile_ = profile_manager_.CreateTestingProfile(
"sync-startup-test", scoped_ptr<syncable_prefs::PrefServiceSyncable>(),
base::UTF8ToUTF16("sync-startup-test"), 0, std::string(),
- testing_facotries);
+ testing_factories);
}
void TearDown() override { sync_->RemoveObserver(&observer_); }
@@ -140,8 +139,9 @@ 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));
+ sync_client->SetSyncApiComponentFactoryForTesting(
+ make_scoped_ptr(new SyncApiComponentFactoryMock()));
return make_scoped_ptr(new TestProfileSyncServiceNoBackup(
sync_client.Pass(), profile,
make_scoped_ptr(new SigninManagerWrapper(
@@ -212,7 +212,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 +246,9 @@ 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));
+ sync_client->SetSyncApiComponentFactoryForTesting(
+ make_scoped_ptr(new SyncApiComponentFactoryMock()));
return make_scoped_ptr(new TestProfileSyncServiceNoBackup(
sync_client.Pass(), profile,
make_scoped_ptr(new SigninManagerWrapper(signin)), oauth2_token_service,
@@ -378,7 +379,7 @@ TEST_F(ProfileSyncServiceStartupCrosTest, StartCrosNoCredentials) {
CreateDataTypeManager(_, _, _, _, _))
.Times(0);
EXPECT_CALL(*GetSyncApiComponentFactoryMock(),
- CreateSyncBackendHost(_, _, _, _, _))
+ CreateSyncBackendHost(_, _, _, _))
.Times(0);
profile_->GetPrefs()->ClearPref(sync_driver::prefs::kSyncHasSetupCompleted);
EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber());
« no previous file with comments | « chrome/browser/sync/profile_sync_service_mock.cc ('k') | chrome/browser/sync/profile_sync_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698