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

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: 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 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 ACTION(ReturnNewSyncBackendHostNoReturn) { 154 ACTION(ReturnNewSyncBackendHostNoReturn) {
155 return new browser_sync::SyncBackendHostNoReturn(); 155 return new browser_sync::SyncBackendHostNoReturn();
156 } 156 }
157 157
158 ACTION_P(ReturnNewMockHostCollectDeleteDirParam, delete_dir_param) { 158 ACTION_P(ReturnNewMockHostCollectDeleteDirParam, delete_dir_param) {
159 return new browser_sync::SyncBackendHostMockCollectDeleteDirParam( 159 return new browser_sync::SyncBackendHostMockCollectDeleteDirParam(
160 delete_dir_param); 160 delete_dir_param);
161 } 161 }
162 162
163 KeyedService* BuildFakeProfileInvalidationProvider( 163 scoped_ptr<KeyedService> BuildFakeProfileInvalidationProvider(
164 content::BrowserContext* context) { 164 content::BrowserContext* context) {
165 return new invalidation::ProfileInvalidationProvider( 165 return make_scoped_ptr(new invalidation::ProfileInvalidationProvider(
166 scoped_ptr<invalidation::InvalidationService>( 166 scoped_ptr<invalidation::InvalidationService>(
167 new invalidation::FakeInvalidationService)); 167 new invalidation::FakeInvalidationService)));
168 } 168 }
169 169
170 // A test harness that uses a real ProfileSyncService and in most cases a 170 // A test harness that uses a real ProfileSyncService and in most cases a
171 // MockSyncBackendHost. 171 // MockSyncBackendHost.
172 // 172 //
173 // This is useful if we want to test the ProfileSyncService and don't care about 173 // This is useful if we want to test the ProfileSyncService and don't care about
174 // testing the SyncBackendHost. 174 // testing the SyncBackendHost.
175 class ProfileSyncServiceTest : public ::testing::Test { 175 class ProfileSyncServiceTest : public ::testing::Test {
176 protected: 176 protected:
177 ProfileSyncServiceTest() 177 ProfileSyncServiceTest()
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 697
698 // Verify memory pressure and shutdown recorded. 698 // Verify memory pressure and shutdown recorded.
699 EXPECT_EQ(profile()->GetPrefs()->GetInteger( 699 EXPECT_EQ(profile()->GetPrefs()->GetInteger(
700 sync_driver::prefs::kSyncMemoryPressureWarningCount), 700 sync_driver::prefs::kSyncMemoryPressureWarningCount),
701 2); 701 2);
702 EXPECT_TRUE(sync_prefs.DidSyncShutdownCleanly()); 702 EXPECT_TRUE(sync_prefs.DidSyncShutdownCleanly());
703 } 703 }
704 704
705 } // namespace 705 } // namespace
706 } // namespace browser_sync 706 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_typed_url_unittest.cc ('k') | chrome/browser/sync/startup_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698