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/callback.h" | 5 #include "base/callback.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 key_version); | 135 key_version); |
136 } | 136 } |
137 | 137 |
138 void GetExpectedDefaultPolicy(PolicyMap* policy_map) { | 138 void GetExpectedDefaultPolicy(PolicyMap* policy_map) { |
139 #if defined(OS_CHROMEOS) | 139 #if defined(OS_CHROMEOS) |
140 policy_map->Set(key::kChromeOsMultiProfileUserBehavior, | 140 policy_map->Set(key::kChromeOsMultiProfileUserBehavior, |
141 POLICY_LEVEL_MANDATORY, | 141 POLICY_LEVEL_MANDATORY, |
142 POLICY_SCOPE_USER, | 142 POLICY_SCOPE_USER, |
143 new base::StringValue("primary-only"), | 143 new base::StringValue("primary-only"), |
144 NULL); | 144 NULL); |
| 145 policy_map->Set(key::kEasyUnlockAllowed, |
| 146 POLICY_LEVEL_MANDATORY, |
| 147 POLICY_SCOPE_USER, |
| 148 new base::FundamentalValue(false), |
| 149 NULL); |
145 #endif | 150 #endif |
146 } | 151 } |
147 | 152 |
148 void GetExpectedTestPolicy(PolicyMap* expected, const char* homepage) { | 153 void GetExpectedTestPolicy(PolicyMap* expected, const char* homepage) { |
149 expected->Set(key::kShowHomeButton, | 154 expected->Set(key::kShowHomeButton, |
150 POLICY_LEVEL_MANDATORY, | 155 POLICY_LEVEL_MANDATORY, |
151 POLICY_SCOPE_USER, | 156 POLICY_SCOPE_USER, |
152 new base::FundamentalValue(true), | 157 new base::FundamentalValue(true), |
153 NULL); | 158 NULL); |
154 expected->Set(key::kRestoreOnStartup, | 159 expected->Set(key::kRestoreOnStartup, |
(...skipping 16 matching lines...) Expand all Loading... |
171 POLICY_LEVEL_RECOMMENDED, | 176 POLICY_LEVEL_RECOMMENDED, |
172 POLICY_SCOPE_USER, | 177 POLICY_SCOPE_USER, |
173 new base::StringValue(homepage), | 178 new base::StringValue(homepage), |
174 NULL); | 179 NULL); |
175 #if defined(OS_CHROMEOS) | 180 #if defined(OS_CHROMEOS) |
176 expected->Set(key::kChromeOsMultiProfileUserBehavior, | 181 expected->Set(key::kChromeOsMultiProfileUserBehavior, |
177 POLICY_LEVEL_MANDATORY, | 182 POLICY_LEVEL_MANDATORY, |
178 POLICY_SCOPE_USER, | 183 POLICY_SCOPE_USER, |
179 new base::StringValue("primary-only"), | 184 new base::StringValue("primary-only"), |
180 NULL); | 185 NULL); |
| 186 expected->Set(key::kEasyUnlockAllowed, |
| 187 POLICY_LEVEL_MANDATORY, |
| 188 POLICY_SCOPE_USER, |
| 189 new base::FundamentalValue(false), |
| 190 NULL); |
181 #endif | 191 #endif |
182 } | 192 } |
183 | 193 |
184 } // namespace | 194 } // namespace |
185 | 195 |
186 // Tests the cloud policy stack(s). | 196 // Tests the cloud policy stack(s). |
187 class CloudPolicyTest : public InProcessBrowserTest, | 197 class CloudPolicyTest : public InProcessBrowserTest, |
188 public PolicyService::Observer { | 198 public PolicyService::Observer { |
189 protected: | 199 protected: |
190 CloudPolicyTest() {} | 200 CloudPolicyTest() {} |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 | 482 |
473 // They should now serialize to the same bytes. | 483 // They should now serialize to the same bytes. |
474 std::string chrome_settings_serialized; | 484 std::string chrome_settings_serialized; |
475 std::string cloud_policy_serialized; | 485 std::string cloud_policy_serialized; |
476 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); | 486 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); |
477 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); | 487 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); |
478 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); | 488 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); |
479 } | 489 } |
480 | 490 |
481 } // namespace policy | 491 } // namespace policy |
OLD | NEW |