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_session_unittest.cc

Issue 23068005: Convert UserPolicySigninService to use OAuth2TokenService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with ToT Created 7 years, 4 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_session_unittest.cc
diff --git a/chrome/browser/sync/profile_sync_service_session_unittest.cc b/chrome/browser/sync/profile_sync_service_session_unittest.cc
index 592a826a56a02a7417180591dcd92c6f12a8bca0..1b4e173b175e79f90425290e3c5719f64c48fa72 100644
--- a/chrome/browser/sync/profile_sync_service_session_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_session_unittest.cc
@@ -212,13 +212,15 @@ class ProfileSyncServiceSessionTest
protected:
virtual TestingProfile* CreateProfile() OVERRIDE {
- TestingProfile* profile = new TestingProfile();
+ TestingProfile::Builder builder;
+ builder.AddTestingFactory(ProfileOAuth2TokenServiceFactory::GetInstance(),
+ FakeOAuth2TokenService::BuildTokenService);
// Don't want the profile to create a real ProfileSyncService.
- ProfileSyncServiceFactory::GetInstance()->SetTestingFactory(profile,
- NULL);
+ builder.AddTestingFactory(ProfileSyncServiceFactory::GetInstance(), NULL);
+ scoped_ptr<TestingProfile> profile(builder.Build());
invalidation::InvalidationServiceFactory::GetInstance()->
SetBuildOnlyFakeInvalidatorsForTest(true);
- return profile;
+ return profile.release();
}
virtual void SetUp() {
@@ -271,8 +273,6 @@ class ProfileSyncServiceSessionTest
SigninManagerBase* signin =
SigninManagerFactory::GetForProfile(profile());
signin->SetAuthenticatedUsername("test_user");
- ProfileOAuth2TokenServiceFactory::GetInstance()->SetTestingFactory(
- profile(), FakeOAuth2TokenService::BuildTokenService);
ProfileSyncComponentsFactoryMock* factory =
new ProfileSyncComponentsFactoryMock();
sync_service_.reset(new FakeProfileSyncService(

Powered by Google App Engine
This is Rietveld 408576698