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/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/prefs/pref_value_map.h" | 7 #include "base/prefs/pref_value_map.h" |
8 #include "chrome/browser/policy/configuration_policy_handler.h" | 8 #include "chrome/browser/policy/configuration_policy_handler.h" |
9 #include "chrome/browser/policy/external_data_fetcher.h" | |
10 #include "chrome/browser/policy/policy_error_map.h" | 9 #include "chrome/browser/policy/policy_error_map.h" |
11 #include "chrome/browser/policy/policy_map.h" | 10 #include "components/policy/core/common/policy_map.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
13 | 12 |
14 namespace policy { | 13 namespace policy { |
15 | 14 |
16 namespace { | 15 namespace { |
17 | 16 |
18 StringToIntEnumListPolicyHandler::MappingEntry kTestTypeMap[] = { | 17 StringToIntEnumListPolicyHandler::MappingEntry kTestTypeMap[] = { |
19 { "one", 1 }, | 18 { "one", 1 }, |
20 { "two", 2 }, | 19 { "two", 2 }, |
21 }; | 20 }; |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, | 477 policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, |
479 POLICY_SCOPE_USER, base::Value::CreateIntegerValue(10), NULL); | 478 POLICY_SCOPE_USER, base::Value::CreateIntegerValue(10), NULL); |
480 prefs.Clear(); | 479 prefs.Clear(); |
481 handler.ApplyPolicySettings(policy_map, &prefs); | 480 handler.ApplyPolicySettings(policy_map, &prefs); |
482 expected.reset(base::Value::CreateDoubleValue(0.1)); | 481 expected.reset(base::Value::CreateDoubleValue(0.1)); |
483 EXPECT_TRUE(prefs.GetValue(kTestPref, &value)); | 482 EXPECT_TRUE(prefs.GetValue(kTestPref, &value)); |
484 EXPECT_TRUE(base::Value::Equals(expected.get(), value)); | 483 EXPECT_TRUE(base::Value::Equals(expected.get(), value)); |
485 } | 484 } |
486 | 485 |
487 } // namespace policy | 486 } // namespace policy |
OLD | NEW |