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

Side by Side Diff: chrome/browser/policy/cloud/user_policy_signin_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/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/memory/scoped_ptr.h"
6 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
7 #include "base/run_loop.h" 8 #include "base/run_loop.h"
8 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
9 #include "base/time/time.h" 10 #include "base/time/time.h"
10 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/chrome_notification_types.h" 12 #include "chrome/browser/chrome_notification_types.h"
12 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" 13 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h"
13 #include "chrome/browser/policy/cloud/user_policy_signin_service_factory.h" 14 #include "chrome/browser/policy/cloud/user_policy_signin_service_factory.h"
14 #include "chrome/browser/prefs/browser_prefs.h" 15 #include "chrome/browser/prefs/browser_prefs.h"
15 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 : FakeSigninManager(profile) { 89 : FakeSigninManager(profile) {
89 Initialize(NULL); 90 Initialize(NULL);
90 } 91 }
91 92
92 void ForceSignOut() { 93 void ForceSignOut() {
93 // Allow signing out now. 94 // Allow signing out now.
94 prohibit_signout_ = false; 95 prohibit_signout_ = false;
95 SignOut(signin_metrics::SIGNOUT_TEST); 96 SignOut(signin_metrics::SIGNOUT_TEST);
96 } 97 }
97 98
98 static KeyedService* Build(content::BrowserContext* profile) { 99 static scoped_ptr<KeyedService> Build(content::BrowserContext* profile) {
99 return new SigninManagerFake(static_cast<Profile*>(profile)); 100 return make_scoped_ptr(
101 new SigninManagerFake(static_cast<Profile*>(profile)));
100 } 102 }
101 }; 103 };
102 104
103 UserCloudPolicyManager* BuildCloudPolicyManager( 105 UserCloudPolicyManager* BuildCloudPolicyManager(
104 content::BrowserContext* context) { 106 content::BrowserContext* context) {
105 MockUserCloudPolicyStore* store = new MockUserCloudPolicyStore(); 107 MockUserCloudPolicyStore* store = new MockUserCloudPolicyStore();
106 EXPECT_CALL(*store, Load()).Times(AnyNumber()); 108 EXPECT_CALL(*store, Load()).Times(AnyNumber());
107 109
108 return new UserCloudPolicyManager( 110 return new UserCloudPolicyManager(
109 scoped_ptr<UserCloudPolicyStore>(store), 111 scoped_ptr<UserCloudPolicyStore>(store),
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 base::RunLoop().RunUntilIdle(); 832 base::RunLoop().RunUntilIdle();
831 EXPECT_FALSE(manager_->IsClientRegistered()); 833 EXPECT_FALSE(manager_->IsClientRegistered());
832 #if !defined(OS_ANDROID) 834 #if !defined(OS_ANDROID)
833 EXPECT_FALSE(signin_manager_->IsSignoutProhibited()); 835 EXPECT_FALSE(signin_manager_->IsSignoutProhibited());
834 #endif 836 #endif
835 } 837 }
836 838
837 } // namespace 839 } // namespace
838 840
839 } // namespace policy 841 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698