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

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

Issue 12088022: Enable cloud policy by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review feedback Created 7 years, 10 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "chrome/browser/policy/browser_policy_connector.h" 8 #include "chrome/browser/policy/browser_policy_connector.h"
9 #include "chrome/browser/policy/cloud_policy_constants.h" 9 #include "chrome/browser/policy/cloud_policy_constants.h"
10 #include "chrome/browser/policy/mock_device_management_service.h" 10 #include "chrome/browser/policy/mock_device_management_service.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 chrome::RegisterLocalState(local_state_.get()); 80 chrome::RegisterLocalState(local_state_.get());
81 TestingBrowserProcess::GetGlobal()->SetLocalState( 81 TestingBrowserProcess::GetGlobal()->SetLocalState(
82 local_state_.get()); 82 local_state_.get());
83 83
84 // Create a testing profile with cloud-policy-on-signin enabled, and bring 84 // Create a testing profile with cloud-policy-on-signin enabled, and bring
85 // up a UserCloudPolicyManager with a MockUserCloudPolicyStore. 85 // up a UserCloudPolicyManager with a MockUserCloudPolicyStore.
86 scoped_ptr<TestingPrefServiceSyncable> prefs( 86 scoped_ptr<TestingPrefServiceSyncable> prefs(
87 new TestingPrefServiceSyncable()); 87 new TestingPrefServiceSyncable());
88 Profile::RegisterUserPrefs(prefs.get()); 88 Profile::RegisterUserPrefs(prefs.get());
89 chrome::RegisterUserPrefs(prefs.get()); 89 chrome::RegisterUserPrefs(prefs.get());
90 prefs->SetUserPref(prefs::kLoadCloudPolicyOnSignin,
91 Value::CreateBooleanValue(true));
92 TestingProfile::Builder builder; 90 TestingProfile::Builder builder;
93 builder.SetPrefService(scoped_ptr<PrefServiceSyncable>(prefs.Pass())); 91 builder.SetPrefService(scoped_ptr<PrefServiceSyncable>(prefs.Pass()));
94 profile_ = builder.Build().Pass(); 92 profile_ = builder.Build().Pass();
95 profile_->CreateRequestContext(); 93 profile_->CreateRequestContext();
96 94
97 mock_store_ = new MockUserCloudPolicyStore(); 95 mock_store_ = new MockUserCloudPolicyStore();
98 EXPECT_CALL(*mock_store_, Load()).Times(AnyNumber()); 96 EXPECT_CALL(*mock_store_, Load()).Times(AnyNumber());
99 manager_.reset(new UserCloudPolicyManager( 97 manager_.reset(new UserCloudPolicyManager(
100 profile_.get(), scoped_ptr<UserCloudPolicyStore>(mock_store_))); 98 profile_.get(), scoped_ptr<UserCloudPolicyStore>(mock_store_)));
101 SigninManagerFactory::GetInstance()->SetTestingFactory( 99 SigninManagerFactory::GetInstance()->SetTestingFactory(
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 SigninManagerFactory::GetForProfile(profile_.get())->SignOut(); 610 SigninManagerFactory::GetForProfile(profile_.get())->SignOut();
613 ASSERT_FALSE(manager_->core()->service()); 611 ASSERT_FALSE(manager_->core()->service());
614 612
615 // Now sign in again. 613 // Now sign in again.
616 TestSuccessfulSignin(); 614 TestSuccessfulSignin();
617 } 615 }
618 616
619 } // namespace 617 } // namespace
620 618
621 } // namespace policy 619 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/user_policy_signin_service_factory.cc ('k') | chrome/browser/prefs/command_line_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698