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

Side by Side Diff: chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc

Issue 18199003: Allow Chrome OS login profile to have different default pref values (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 5 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 | Annotate | Revision Log
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/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 TestingBrowserProcess::GetGlobal()->SetLocalState(local_state_.get()); 118 TestingBrowserProcess::GetGlobal()->SetLocalState(local_state_.get());
119 119
120 scoped_refptr<net::URLRequestContextGetter> system_request_context; 120 scoped_refptr<net::URLRequestContextGetter> system_request_context;
121 g_browser_process->browser_policy_connector()->Init( 121 g_browser_process->browser_policy_connector()->Init(
122 local_state_.get(), system_request_context); 122 local_state_.get(), system_request_context);
123 123
124 // Create a testing profile with cloud-policy-on-signin enabled, and bring 124 // Create a testing profile with cloud-policy-on-signin enabled, and bring
125 // up a UserCloudPolicyManager with a MockUserCloudPolicyStore. 125 // up a UserCloudPolicyManager with a MockUserCloudPolicyStore.
126 scoped_ptr<TestingPrefServiceSyncable> prefs( 126 scoped_ptr<TestingPrefServiceSyncable> prefs(
127 new TestingPrefServiceSyncable()); 127 new TestingPrefServiceSyncable());
128 chrome::RegisterUserPrefs(prefs->registry()); 128 chrome::RegisterUserProfilePrefs(prefs->registry());
129 TestingProfile::Builder builder; 129 TestingProfile::Builder builder;
130 builder.SetPrefService(scoped_ptr<PrefServiceSyncable>(prefs.Pass())); 130 builder.SetPrefService(scoped_ptr<PrefServiceSyncable>(prefs.Pass()));
131 profile_ = builder.Build().Pass(); 131 profile_ = builder.Build().Pass();
132 profile_->CreateRequestContext(); 132 profile_->CreateRequestContext();
133 133
134 mock_store_ = new MockUserCloudPolicyStore(); 134 mock_store_ = new MockUserCloudPolicyStore();
135 EXPECT_CALL(*mock_store_, Load()).Times(AnyNumber()); 135 EXPECT_CALL(*mock_store_, Load()).Times(AnyNumber());
136 manager_.reset(new UserCloudPolicyManager( 136 manager_.reset(new UserCloudPolicyManager(
137 profile_.get(), scoped_ptr<UserCloudPolicyStore>(mock_store_))); 137 profile_.get(), scoped_ptr<UserCloudPolicyStore>(mock_store_)));
138 signin_manager_ = static_cast<SigninManagerFake*>( 138 signin_manager_ = static_cast<SigninManagerFake*>(
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 base::RunLoop().RunUntilIdle(); 726 base::RunLoop().RunUntilIdle();
727 EXPECT_FALSE(manager_->IsClientRegistered()); 727 EXPECT_FALSE(manager_->IsClientRegistered());
728 #if !defined(OS_ANDROID) 728 #if !defined(OS_ANDROID)
729 EXPECT_FALSE(signin_manager_->IsSignoutProhibited()); 729 EXPECT_FALSE(signin_manager_->IsSignoutProhibited());
730 #endif 730 #endif
731 } 731 }
732 732
733 } // namespace 733 } // namespace
734 734
735 } // namespace policy 735 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698