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

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

Issue 12315053: Fix prefs registration in SyncPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 9 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/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "chrome/browser/policy/browser_policy_connector.h" 9 #include "chrome/browser/policy/browser_policy_connector.h"
10 #include "chrome/browser/policy/cloud_policy_constants.h" 10 #include "chrome/browser/policy/cloud_policy_constants.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 local_state_.reset(new TestingPrefServiceSimple); 93 local_state_.reset(new TestingPrefServiceSimple);
94 chrome::RegisterLocalState(local_state_->registry()); 94 chrome::RegisterLocalState(local_state_->registry());
95 TestingBrowserProcess::GetGlobal()->SetLocalState( 95 TestingBrowserProcess::GetGlobal()->SetLocalState(
96 local_state_.get()); 96 local_state_.get());
97 97
98 // Create a testing profile with cloud-policy-on-signin enabled, and bring 98 // Create a testing profile with cloud-policy-on-signin enabled, and bring
99 // up a UserCloudPolicyManager with a MockUserCloudPolicyStore. 99 // up a UserCloudPolicyManager with a MockUserCloudPolicyStore.
100 scoped_ptr<TestingPrefServiceSyncable> prefs( 100 scoped_ptr<TestingPrefServiceSyncable> prefs(
101 new TestingPrefServiceSyncable()); 101 new TestingPrefServiceSyncable());
102 Profile::RegisterUserPrefs(prefs->registry());
103 chrome::RegisterUserPrefs(prefs.get(), prefs->registry()); 102 chrome::RegisterUserPrefs(prefs.get(), prefs->registry());
104 TestingProfile::Builder builder; 103 TestingProfile::Builder builder;
105 builder.SetPrefService(scoped_ptr<PrefServiceSyncable>(prefs.Pass())); 104 builder.SetPrefService(scoped_ptr<PrefServiceSyncable>(prefs.Pass()));
106 profile_ = builder.Build().Pass(); 105 profile_ = builder.Build().Pass();
107 profile_->CreateRequestContext(); 106 profile_->CreateRequestContext();
108 107
109 mock_store_ = new MockUserCloudPolicyStore(); 108 mock_store_ = new MockUserCloudPolicyStore();
110 EXPECT_CALL(*mock_store_, Load()).Times(AnyNumber()); 109 EXPECT_CALL(*mock_store_, Load()).Times(AnyNumber());
111 manager_.reset(new UserCloudPolicyManager( 110 manager_.reset(new UserCloudPolicyManager(
112 profile_.get(), scoped_ptr<UserCloudPolicyStore>(mock_store_))); 111 profile_.get(), scoped_ptr<UserCloudPolicyStore>(mock_store_)));
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 signin_manager_->ForceSignOut(); 628 signin_manager_->ForceSignOut();
630 ASSERT_FALSE(manager_->core()->service()); 629 ASSERT_FALSE(manager_->core()->service());
631 630
632 // Now sign in again. 631 // Now sign in again.
633 TestSuccessfulSignin(); 632 TestSuccessfulSignin();
634 } 633 }
635 634
636 } // namespace 635 } // namespace
637 636
638 } // namespace policy 637 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698