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

Side by Side Diff: chrome/browser/sync/profile_sync_service_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: Rebase 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 ACTION(ReturnNewSyncBackendHostNoReturn) { 156 ACTION(ReturnNewSyncBackendHostNoReturn) {
157 return new browser_sync::SyncBackendHostNoReturn(); 157 return new browser_sync::SyncBackendHostNoReturn();
158 } 158 }
159 159
160 ACTION_P(ReturnNewMockHostCollectDeleteDirParam, delete_dir_param) { 160 ACTION_P(ReturnNewMockHostCollectDeleteDirParam, delete_dir_param) {
161 return new browser_sync::SyncBackendHostMockCollectDeleteDirParam( 161 return new browser_sync::SyncBackendHostMockCollectDeleteDirParam(
162 delete_dir_param); 162 delete_dir_param);
163 } 163 }
164 164
165 KeyedService* BuildFakeProfileInvalidationProvider( 165 scoped_ptr<KeyedService> BuildFakeProfileInvalidationProvider(
166 content::BrowserContext* context) { 166 content::BrowserContext* context) {
167 return new invalidation::ProfileInvalidationProvider( 167 return make_scoped_ptr(new invalidation::ProfileInvalidationProvider(
168 scoped_ptr<invalidation::InvalidationService>( 168 scoped_ptr<invalidation::InvalidationService>(
169 new invalidation::FakeInvalidationService)); 169 new invalidation::FakeInvalidationService)));
170 } 170 }
171 171
172 // A test harness that uses a real ProfileSyncService and in most cases a 172 // A test harness that uses a real ProfileSyncService and in most cases a
173 // MockSyncBackendHost. 173 // MockSyncBackendHost.
174 // 174 //
175 // This is useful if we want to test the ProfileSyncService and don't care about 175 // This is useful if we want to test the ProfileSyncService and don't care about
176 // testing the SyncBackendHost. 176 // testing the SyncBackendHost.
177 class ProfileSyncServiceTest : public ::testing::Test { 177 class ProfileSyncServiceTest : public ::testing::Test {
178 protected: 178 protected:
179 ProfileSyncServiceTest() 179 ProfileSyncServiceTest()
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 699
700 // Verify memory pressure and shutdown recorded. 700 // Verify memory pressure and shutdown recorded.
701 EXPECT_EQ(profile()->GetPrefs()->GetInteger( 701 EXPECT_EQ(profile()->GetPrefs()->GetInteger(
702 sync_driver::prefs::kSyncMemoryPressureWarningCount), 702 sync_driver::prefs::kSyncMemoryPressureWarningCount),
703 2); 703 2);
704 EXPECT_TRUE(sync_prefs.DidSyncShutdownCleanly()); 704 EXPECT_TRUE(sync_prefs.DidSyncShutdownCleanly());
705 } 705 }
706 706
707 } // namespace 707 } // namespace
708 } // namespace browser_sync 708 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698