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/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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 virtual void SetUp() OVERRIDE { | 71 virtual void SetUp() OVERRIDE { |
72 device_management_service_ = new MockDeviceManagementService(); | 72 device_management_service_ = new MockDeviceManagementService(); |
73 g_browser_process->browser_policy_connector()-> | 73 g_browser_process->browser_policy_connector()-> |
74 SetDeviceManagementServiceForTesting( | 74 SetDeviceManagementServiceForTesting( |
75 scoped_ptr<DeviceManagementService>(device_management_service_)); | 75 scoped_ptr<DeviceManagementService>(device_management_service_)); |
76 | 76 |
77 g_browser_process->browser_policy_connector()->Init(); | 77 g_browser_process->browser_policy_connector()->Init(); |
78 | 78 |
79 local_state_.reset(new TestingPrefServiceSimple); | 79 local_state_.reset(new TestingPrefServiceSimple); |
80 chrome::RegisterLocalState(local_state_.get()); | 80 chrome::RegisterLocalState(local_state_->registry(), 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 TestingProfile::Builder builder; | 90 TestingProfile::Builder builder; |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 SigninManagerFactory::GetForProfile(profile_.get())->SignOut(); | 610 SigninManagerFactory::GetForProfile(profile_.get())->SignOut(); |
611 ASSERT_FALSE(manager_->core()->service()); | 611 ASSERT_FALSE(manager_->core()->service()); |
612 | 612 |
613 // Now sign in again. | 613 // Now sign in again. |
614 TestSuccessfulSignin(); | 614 TestSuccessfulSignin(); |
615 } | 615 } |
616 | 616 |
617 } // namespace | 617 } // namespace |
618 | 618 |
619 } // namespace policy | 619 } // namespace policy |
OLD | NEW |