OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/prefs/pref_value_map.h" | 5 #include "base/prefs/pref_value_map.h" |
6 #include "chrome/browser/extensions/external_policy_loader.h" | 6 #include "chrome/browser/extensions/external_policy_loader.h" |
7 #include "chrome/browser/extensions/policy_handlers.h" | 7 #include "chrome/browser/extensions/policy_handlers.h" |
8 #include "chrome/browser/policy/policy_error_map.h" | 8 #include "chrome/browser/policy/policy_error_map.h" |
9 #include "chrome/browser/policy/policy_map.h" | |
10 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 10 #include "components/policy/core/common/policy_map.h" |
11 #include "policy/policy_constants.h" | 11 #include "policy/policy_constants.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 namespace extensions { | 14 namespace extensions { |
15 | 15 |
16 const char kTestPref[] = "unit_test.test_pref"; | 16 const char kTestPref[] = "unit_test.test_pref"; |
17 | 17 |
18 TEST(ExtensionListPolicyHandlerTest, CheckPolicySettings) { | 18 TEST(ExtensionListPolicyHandlerTest, CheckPolicySettings) { |
19 base::ListValue list; | 19 base::ListValue list; |
20 policy::PolicyMap policy_map; | 20 policy::PolicyMap policy_map; |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 policy::POLICY_LEVEL_MANDATORY, | 274 policy::POLICY_LEVEL_MANDATORY, |
275 policy::POLICY_SCOPE_USER, | 275 policy::POLICY_SCOPE_USER, |
276 list.DeepCopy(), | 276 list.DeepCopy(), |
277 NULL); | 277 NULL); |
278 handler.ApplyPolicySettings(policy_map, &prefs); | 278 handler.ApplyPolicySettings(policy_map, &prefs); |
279 ASSERT_TRUE(prefs.GetValue(kTestPref, &value)); | 279 ASSERT_TRUE(prefs.GetValue(kTestPref, &value)); |
280 EXPECT_TRUE(base::Value::Equals(&list, value)); | 280 EXPECT_TRUE(base::Value::Equals(&list, value)); |
281 } | 281 } |
282 | 282 |
283 } // namespace extensions | 283 } // namespace extensions |
OLD | NEW |