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

Side by Side Diff: chrome/browser/extensions/api/preferences_private/preferences_private_apitest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/bind.h" 6 #include "base/bind.h"
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h"
11 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
12 #include "base/path_service.h" 13 #include "base/path_service.h"
13 #include "base/values.h" 14 #include "base/values.h"
14 #include "chrome/browser/browser_process.h" 15 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/extensions/api/preferences_private/preferences_private_ api.h" 16 #include "chrome/browser/extensions/api/preferences_private/preferences_private_ api.h"
16 #include "chrome/browser/extensions/extension_apitest.h" 17 #include "chrome/browser/extensions/extension_apitest.h"
17 #include "chrome/browser/extensions/extension_function_test_utils.h" 18 #include "chrome/browser/extensions/extension_function_test_utils.h"
18 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/browser/profiles/profile_manager.h" 20 #include "chrome/browser/profiles/profile_manager.h"
20 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 21 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
(...skipping 26 matching lines...) Expand all
47 new ProfileSyncComponentsFactoryMock()), 48 new ProfileSyncComponentsFactoryMock()),
48 profile, 49 profile,
49 make_scoped_ptr<SupervisedUserSigninManagerWrapper>(NULL), 50 make_scoped_ptr<SupervisedUserSigninManagerWrapper>(NULL),
50 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), 51 ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
51 browser_sync::MANUAL_START), 52 browser_sync::MANUAL_START),
52 sync_initialized_(true), 53 sync_initialized_(true),
53 initialized_state_violation_(false) {} 54 initialized_state_violation_(false) {}
54 55
55 ~FakeProfileSyncService() override {} 56 ~FakeProfileSyncService() override {}
56 57
57 static KeyedService* BuildFakeProfileSyncService( 58 static scoped_ptr<KeyedService> BuildFakeProfileSyncService(
58 content::BrowserContext* context) { 59 content::BrowserContext* context) {
59 return new FakeProfileSyncService(static_cast<Profile*>(context)); 60 return make_scoped_ptr(
61 new FakeProfileSyncService(static_cast<Profile*>(context)));
60 } 62 }
61 63
62 void set_sync_initialized(bool sync_initialized) { 64 void set_sync_initialized(bool sync_initialized) {
63 sync_initialized_ = sync_initialized; 65 sync_initialized_ = sync_initialized;
64 } 66 }
65 67
66 bool initialized_state_violation() { return initialized_state_violation_; } 68 bool initialized_state_violation() { return initialized_state_violation_; }
67 69
68 // ProfileSyncService: 70 // ProfileSyncService:
69 bool IsSyncActive() const override { return sync_initialized_; } 71 bool IsSyncActive() const override { return sync_initialized_; }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 189
188 // Verifies that we wait for the sync service to be ready before checking 190 // Verifies that we wait for the sync service to be ready before checking
189 // encryption status. 191 // encryption status.
190 IN_PROC_BROWSER_TEST_F(PreferencesPrivateApiTest, 192 IN_PROC_BROWSER_TEST_F(PreferencesPrivateApiTest,
191 GetSyncCategoriesWithoutPassphraseAsynchronous) { 193 GetSyncCategoriesWithoutPassphraseAsynchronous) {
192 service_->set_sync_initialized(false); 194 service_->set_sync_initialized(false);
193 TestGetSyncCategoriesWithoutPassphraseFunction(); 195 TestGetSyncCategoriesWithoutPassphraseFunction();
194 } 196 }
195 197
196 } // namespace 198 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698