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 <memory> | 5 #include <memory> |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 base::ListValue list; | 162 base::ListValue list; |
163 list.AppendString("dev.chromium.org"); | 163 list.AppendString("dev.chromium.org"); |
164 list.AppendString("youtube.com"); | 164 list.AppendString("youtube.com"); |
165 expected->Set(key::kURLBlacklist, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, | 165 expected->Set(key::kURLBlacklist, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, |
166 POLICY_SOURCE_CLOUD, list.CreateDeepCopy(), nullptr); | 166 POLICY_SOURCE_CLOUD, list.CreateDeepCopy(), nullptr); |
167 expected->Set(key::kMaxInvalidationFetchDelay, POLICY_LEVEL_MANDATORY, | 167 expected->Set(key::kMaxInvalidationFetchDelay, POLICY_LEVEL_MANDATORY, |
168 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, | 168 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, |
169 base::MakeUnique<base::Value>(1000), nullptr); | 169 base::MakeUnique<base::Value>(1000), nullptr); |
170 expected->Set(key::kHomepageLocation, POLICY_LEVEL_RECOMMENDED, | 170 expected->Set(key::kHomepageLocation, POLICY_LEVEL_RECOMMENDED, |
171 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, | 171 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, |
172 base::MakeUnique<base::StringValue>(homepage), nullptr); | 172 base::MakeUnique<base::Value>(homepage), nullptr); |
173 } | 173 } |
174 | 174 |
175 } // namespace | 175 } // namespace |
176 | 176 |
177 // Tests the cloud policy stack(s). | 177 // Tests the cloud policy stack(s). |
178 class CloudPolicyTest : public InProcessBrowserTest, | 178 class CloudPolicyTest : public InProcessBrowserTest, |
179 public PolicyService::Observer { | 179 public PolicyService::Observer { |
180 protected: | 180 protected: |
181 CloudPolicyTest() {} | 181 CloudPolicyTest() {} |
182 ~CloudPolicyTest() override {} | 182 ~CloudPolicyTest() override {} |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 | 491 |
492 // They should now serialize to the same bytes. | 492 // They should now serialize to the same bytes. |
493 std::string chrome_settings_serialized; | 493 std::string chrome_settings_serialized; |
494 std::string cloud_policy_serialized; | 494 std::string cloud_policy_serialized; |
495 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); | 495 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); |
496 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); | 496 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); |
497 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); | 497 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); |
498 } | 498 } |
499 | 499 |
500 } // namespace policy | 500 } // namespace policy |
OLD | NEW |