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

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

Issue 1165913002: [Cleanup] Used scoped pointers in KeyedServiceFactory's SetTestingFactory functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finish renaming profile -> context Created 5 years, 6 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_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 79265398167dd63f000d8359542838c34b1036d0..12c2f7ed53b0679d8fb98fc96fdce7f8bc98612c 100644
--- a/chrome/browser/sync/profile_sync_service_startup_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_startup_unittest.cc
@@ -121,16 +121,16 @@ class ProfileSyncServiceStartupTest : public testing::Test {
void TearDown() override { sync_->RemoveObserver(&observer_); }
- static KeyedService* BuildService(content::BrowserContext* browser_context) {
+ static scoped_ptr<KeyedService> BuildService(
+ content::BrowserContext* browser_context) {
Profile* profile = static_cast<Profile*>(browser_context);
- return new TestProfileSyncServiceNoBackup(
+ return make_scoped_ptr(new TestProfileSyncServiceNoBackup(
scoped_ptr<ProfileSyncComponentsFactory>(
new ProfileSyncComponentsFactoryMock()),
- profile,
- make_scoped_ptr(new SupervisedUserSigninManagerWrapper(
- profile, SigninManagerFactory::GetForProfile(profile))),
+ profile, make_scoped_ptr(new SupervisedUserSigninManagerWrapper(
+ profile, SigninManagerFactory::GetForProfile(profile))),
ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
- browser_sync::MANUAL_START);
+ browser_sync::MANUAL_START));
}
void CreateSyncService() {
@@ -217,7 +217,8 @@ class ProfileSyncServiceStartupCrosTest : public ProfileSyncServiceStartupTest {
sync_->AddObserver(&observer_);
}
- static KeyedService* BuildCrosService(content::BrowserContext* context) {
+ static scoped_ptr<KeyedService> BuildCrosService(
+ content::BrowserContext* context) {
Profile* profile = static_cast<Profile*>(context);
FakeSigninManagerForTesting* signin =
static_cast<FakeSigninManagerForTesting*>(
@@ -226,14 +227,12 @@ class ProfileSyncServiceStartupCrosTest : public ProfileSyncServiceStartupTest {
ProfileOAuth2TokenService* oauth2_token_service =
ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
EXPECT_TRUE(signin->IsAuthenticated());
- return new TestProfileSyncServiceNoBackup(
+ return make_scoped_ptr(new TestProfileSyncServiceNoBackup(
scoped_ptr<ProfileSyncComponentsFactory>(
new ProfileSyncComponentsFactoryMock()),
- profile,
- make_scoped_ptr(new SupervisedUserSigninManagerWrapper(profile,
- signin)),
- oauth2_token_service,
- browser_sync::AUTO_START);
+ profile, make_scoped_ptr(
+ new SupervisedUserSigninManagerWrapper(profile, signin)),
+ oauth2_token_service, browser_sync::AUTO_START));
}
};
« no previous file with comments | « chrome/browser/sync/profile_sync_service_mock.cc ('k') | chrome/browser/sync/profile_sync_service_typed_url_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698