| OLD | NEW |
| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 virtual void SetUp() OVERRIDE { | 85 virtual void SetUp() OVERRIDE { |
| 86 device_management_service_ = new MockDeviceManagementService(); | 86 device_management_service_ = new MockDeviceManagementService(); |
| 87 g_browser_process->browser_policy_connector()-> | 87 g_browser_process->browser_policy_connector()-> |
| 88 SetDeviceManagementServiceForTesting( | 88 SetDeviceManagementServiceForTesting( |
| 89 scoped_ptr<DeviceManagementService>(device_management_service_)); | 89 scoped_ptr<DeviceManagementService>(device_management_service_)); |
| 90 | 90 |
| 91 g_browser_process->browser_policy_connector()->Init(); | 91 g_browser_process->browser_policy_connector()->Init(); |
| 92 | 92 |
| 93 local_state_.reset(new TestingPrefServiceSimple); | 93 local_state_.reset(new TestingPrefServiceSimple); |
| 94 chrome::RegisterLocalState(local_state_.get(), 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()); | 102 Profile::RegisterUserPrefs(prefs->registry()); |
| 103 chrome::RegisterUserPrefs(prefs.get(), prefs->registry()); | 103 chrome::RegisterUserPrefs(prefs.get(), prefs->registry()); |
| 104 TestingProfile::Builder builder; | 104 TestingProfile::Builder builder; |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 signin_manager_->ForceSignOut(); | 629 signin_manager_->ForceSignOut(); |
| 630 ASSERT_FALSE(manager_->core()->service()); | 630 ASSERT_FALSE(manager_->core()->service()); |
| 631 | 631 |
| 632 // Now sign in again. | 632 // Now sign in again. |
| 633 TestSuccessfulSignin(); | 633 TestSuccessfulSignin(); |
| 634 } | 634 } |
| 635 | 635 |
| 636 } // namespace | 636 } // namespace |
| 637 | 637 |
| 638 } // namespace policy | 638 } // namespace policy |
| OLD | NEW |