| 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 "chrome/browser/policy/policy_loader_win.h" | 5 #include "chrome/browser/policy/policy_loader_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| 11 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "base/win/registry.h" | 14 #include "base/win/registry.h" |
| 15 #include "chrome/browser/policy/async_policy_provider.h" | 15 #include "chrome/browser/policy/async_policy_provider.h" |
| 16 #include "chrome/browser/policy/configuration_policy_provider_test.h" | 16 #include "chrome/browser/policy/configuration_policy_provider_test.h" |
| 17 #include "chrome/browser/policy/policy_bundle.h" | 17 #include "chrome/browser/policy/policy_bundle.h" |
| 18 #include "chrome/browser/policy/policy_map.h" | 18 #include "chrome/browser/policy/policy_map.h" |
| 19 #include "chrome/common/json_schema_constants.h" |
| 19 #include "policy/policy_constants.h" | 20 #include "policy/policy_constants.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 21 | 22 |
| 22 using base::win::RegKey; | 23 using base::win::RegKey; |
| 24 using namespace json_schema_constants; |
| 23 using namespace policy::registry_constants; | 25 using namespace policy::registry_constants; |
| 24 | 26 |
| 25 namespace policy { | 27 namespace policy { |
| 26 | 28 |
| 27 namespace { | 29 namespace { |
| 28 | 30 |
| 29 const wchar_t kUnitTestRegistrySubKey[] = L"SOFTWARE\\Chromium Unit Tests"; | 31 const wchar_t kUnitTestRegistrySubKey[] = L"SOFTWARE\\Chromium Unit Tests"; |
| 30 const wchar_t kUnitTestMachineOverrideSubKey[] = | 32 const wchar_t kUnitTestMachineOverrideSubKey[] = |
| 31 L"SOFTWARE\\Chromium Unit Tests\\HKLM Override"; | 33 L"SOFTWARE\\Chromium Unit Tests\\HKLM Override"; |
| 32 const wchar_t kUnitTestUserOverrideSubKey[] = | 34 const wchar_t kUnitTestUserOverrideSubKey[] = |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 expected_policy.SetInteger("special-int2", -456); | 609 expected_policy.SetInteger("special-int2", -456); |
| 608 expected_policy.SetDouble("double1", 789.0); | 610 expected_policy.SetDouble("double1", 789.0); |
| 609 expected_policy.SetDouble("double2", 123.456e7); | 611 expected_policy.SetDouble("double2", 123.456e7); |
| 610 PolicyBundle expected; | 612 PolicyBundle expected; |
| 611 expected.Get(POLICY_DOMAIN_EXTENSIONS, "test") | 613 expected.Get(POLICY_DOMAIN_EXTENSIONS, "test") |
| 612 .LoadFrom(&expected_policy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER); | 614 .LoadFrom(&expected_policy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER); |
| 613 EXPECT_TRUE(Matches(expected)); | 615 EXPECT_TRUE(Matches(expected)); |
| 614 } | 616 } |
| 615 | 617 |
| 616 } // namespace policy | 618 } // namespace policy |
| OLD | NEW |