| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 homepage, | 133 homepage, |
| 134 GetTestUser(), | 134 GetTestUser(), |
| 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("not-allowed"), |
| 144 NULL); | 144 NULL); |
| 145 #endif | 145 #endif |
| 146 } | 146 } |
| 147 | 147 |
| 148 void GetExpectedTestPolicy(PolicyMap* expected, const char* homepage) { | 148 void GetExpectedTestPolicy(PolicyMap* expected, const char* homepage) { |
| 149 expected->Set(key::kShowHomeButton, | 149 expected->Set(key::kShowHomeButton, |
| 150 POLICY_LEVEL_MANDATORY, | 150 POLICY_LEVEL_MANDATORY, |
| 151 POLICY_SCOPE_USER, | 151 POLICY_SCOPE_USER, |
| 152 new base::FundamentalValue(true), | 152 new base::FundamentalValue(true), |
| 153 NULL); | 153 NULL); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 169 NULL); | 169 NULL); |
| 170 expected->Set(key::kHomepageLocation, | 170 expected->Set(key::kHomepageLocation, |
| 171 POLICY_LEVEL_RECOMMENDED, | 171 POLICY_LEVEL_RECOMMENDED, |
| 172 POLICY_SCOPE_USER, | 172 POLICY_SCOPE_USER, |
| 173 new base::StringValue(homepage), | 173 new base::StringValue(homepage), |
| 174 NULL); | 174 NULL); |
| 175 #if defined(OS_CHROMEOS) | 175 #if defined(OS_CHROMEOS) |
| 176 expected->Set(key::kChromeOsMultiProfileUserBehavior, | 176 expected->Set(key::kChromeOsMultiProfileUserBehavior, |
| 177 POLICY_LEVEL_MANDATORY, | 177 POLICY_LEVEL_MANDATORY, |
| 178 POLICY_SCOPE_USER, | 178 POLICY_SCOPE_USER, |
| 179 new base::StringValue("primary-only"), | 179 new base::StringValue("not-allowed"), |
| 180 NULL); | 180 NULL); |
| 181 #endif | 181 #endif |
| 182 } | 182 } |
| 183 | 183 |
| 184 } // namespace | 184 } // namespace |
| 185 | 185 |
| 186 // Tests the cloud policy stack(s). | 186 // Tests the cloud policy stack(s). |
| 187 class CloudPolicyTest : public InProcessBrowserTest, | 187 class CloudPolicyTest : public InProcessBrowserTest, |
| 188 public PolicyService::Observer { | 188 public PolicyService::Observer { |
| 189 protected: | 189 protected: |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 | 472 |
| 473 // They should now serialize to the same bytes. | 473 // They should now serialize to the same bytes. |
| 474 std::string chrome_settings_serialized; | 474 std::string chrome_settings_serialized; |
| 475 std::string cloud_policy_serialized; | 475 std::string cloud_policy_serialized; |
| 476 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); | 476 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); |
| 477 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); | 477 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); |
| 478 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); | 478 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); |
| 479 } | 479 } |
| 480 | 480 |
| 481 } // namespace policy | 481 } // namespace policy |
| OLD | NEW |