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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 // Set up a policy map for testing. | 113 // Set up a policy map for testing. |
114 policy_map_.Set(key::kHomepageLocation, | 114 policy_map_.Set(key::kHomepageLocation, |
115 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, | 115 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, |
116 new base::StringValue("http://chromium.org"), | 116 new base::StringValue("http://chromium.org"), |
117 NULL); | 117 NULL); |
118 policy_map_.Set(key::kChromeOsMultiProfileUserBehavior, | 118 policy_map_.Set(key::kChromeOsMultiProfileUserBehavior, |
119 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, | 119 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, |
120 new base::StringValue("primary-only"), | 120 new base::StringValue("primary-only"), |
121 NULL); | 121 NULL); |
| 122 policy_map_.Set(key::kEasyUnlockAllowed, |
| 123 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, |
| 124 new base::FundamentalValue(false), |
| 125 NULL); |
122 expected_bundle_.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) | 126 expected_bundle_.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) |
123 .CopyFrom(policy_map_); | 127 .CopyFrom(policy_map_); |
124 | 128 |
125 // Create fake policy blobs to deliver to the client. | 129 // Create fake policy blobs to deliver to the client. |
126 em::DeviceRegisterResponse* register_response = | 130 em::DeviceRegisterResponse* register_response = |
127 register_blob_.mutable_register_response(); | 131 register_blob_.mutable_register_response(); |
128 register_response->set_device_management_token("dmtoken123"); | 132 register_response->set_device_management_token("dmtoken123"); |
129 | 133 |
130 em::CloudPolicySettings policy_proto; | 134 em::CloudPolicySettings policy_proto; |
131 policy_proto.mutable_homepagelocation()->set_value("http://chromium.org"); | 135 policy_proto.mutable_homepagelocation()->set_value("http://chromium.org"); |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); | 586 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); |
583 EXPECT_TRUE(manager_->core()->client()->is_registered()); | 587 EXPECT_TRUE(manager_->core()->client()->is_registered()); |
584 | 588 |
585 // The refresh scheduler takes care of the initial fetch for unmanaged users. | 589 // The refresh scheduler takes care of the initial fetch for unmanaged users. |
586 // Running the task runner issues the initial fetch. | 590 // Running the task runner issues the initial fetch. |
587 FetchPolicy( | 591 FetchPolicy( |
588 base::Bind(&base::TestSimpleTaskRunner::RunUntilIdle, task_runner_)); | 592 base::Bind(&base::TestSimpleTaskRunner::RunUntilIdle, task_runner_)); |
589 } | 593 } |
590 | 594 |
591 } // namespace policy | 595 } // namespace policy |
OLD | NEW |