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 "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 chrome::RegisterLocalState(prefs_.registry()); | 107 chrome::RegisterLocalState(prefs_.registry()); |
108 | 108 |
109 // Set up a policy map for testing. | 109 // Set up a policy map for testing. |
110 policy_map_.Set(key::kHomepageLocation, | 110 policy_map_.Set(key::kHomepageLocation, |
111 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, | 111 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, |
112 new base::StringValue("http://chromium.org"), | 112 new base::StringValue("http://chromium.org"), |
113 NULL); | 113 NULL); |
114 policy_map_.Set(key::kChromeOsMultiProfileUserBehavior, | 114 policy_map_.Set(key::kChromeOsMultiProfileUserBehavior, |
115 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, | 115 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, |
116 new base::StringValue("not-allowed"), | 116 new base::StringValue("primary-only"), |
117 NULL); | 117 NULL); |
118 expected_bundle_.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) | 118 expected_bundle_.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) |
119 .CopyFrom(policy_map_); | 119 .CopyFrom(policy_map_); |
120 | 120 |
121 // Create fake policy blobs to deliver to the client. | 121 // Create fake policy blobs to deliver to the client. |
122 em::DeviceRegisterResponse* register_response = | 122 em::DeviceRegisterResponse* register_response = |
123 register_blob_.mutable_register_response(); | 123 register_blob_.mutable_register_response(); |
124 register_response->set_device_management_token("dmtoken123"); | 124 register_response->set_device_management_token("dmtoken123"); |
125 | 125 |
126 em::CloudPolicySettings policy_proto; | 126 em::CloudPolicySettings policy_proto; |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); | 578 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); |
579 EXPECT_TRUE(manager_->core()->client()->is_registered()); | 579 EXPECT_TRUE(manager_->core()->client()->is_registered()); |
580 | 580 |
581 // The refresh scheduler takes care of the initial fetch for unmanaged users. | 581 // The refresh scheduler takes care of the initial fetch for unmanaged users. |
582 // Running the task runner issues the initial fetch. | 582 // Running the task runner issues the initial fetch. |
583 FetchPolicy( | 583 FetchPolicy( |
584 base::Bind(&base::TestSimpleTaskRunner::RunUntilIdle, task_runner_)); | 584 base::Bind(&base::TestSimpleTaskRunner::RunUntilIdle, task_runner_)); |
585 } | 585 } |
586 | 586 |
587 } // namespace policy | 587 } // namespace policy |
OLD | NEW |