| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <gtest/gtest.h> | 5 #include <gtest/gtest.h> |
| 6 #include <windows.h> | 6 #include <windows.h> |
| 7 | 7 |
| 8 #include "base/string16.h" | 8 #include "base/string16.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 }; | 210 }; |
| 211 | 211 |
| 212 TEST_F(ConfigurationPolicyProviderWinTest, HKLMOverHKCU) { | 212 TEST_F(ConfigurationPolicyProviderWinTest, HKLMOverHKCU) { |
| 213 RegKey hklm_key(HKEY_LOCAL_MACHINE, policy::kRegistrySubKey, KEY_ALL_ACCESS); | 213 RegKey hklm_key(HKEY_LOCAL_MACHINE, policy::kRegistrySubKey, KEY_ALL_ACCESS); |
| 214 hklm_key.WriteValue(UTF8ToUTF16(test_policy_definitions::kKeyString).c_str(), | 214 hklm_key.WriteValue(UTF8ToUTF16(test_policy_definitions::kKeyString).c_str(), |
| 215 UTF8ToUTF16("hklm").c_str()); | 215 UTF8ToUTF16("hklm").c_str()); |
| 216 RegKey hkcu_key(HKEY_CURRENT_USER, policy::kRegistrySubKey, KEY_ALL_ACCESS); | 216 RegKey hkcu_key(HKEY_CURRENT_USER, policy::kRegistrySubKey, KEY_ALL_ACCESS); |
| 217 hkcu_key.WriteValue(UTF8ToUTF16(test_policy_definitions::kKeyString).c_str(), | 217 hkcu_key.WriteValue(UTF8ToUTF16(test_policy_definitions::kKeyString).c_str(), |
| 218 UTF8ToUTF16("hkcu").c_str()); | 218 UTF8ToUTF16("hkcu").c_str()); |
| 219 | 219 |
| 220 provider_.ForceReload(); | 220 provider_.RefreshPolicies(); |
| 221 loop_.RunAllPending(); | 221 loop_.RunAllPending(); |
| 222 | 222 |
| 223 PolicyMap policy_map; | 223 PolicyMap policy_map; |
| 224 provider_.Provide(&policy_map); | 224 provider_.Provide(&policy_map); |
| 225 const Value* value = policy_map.Get(test_policy_definitions::kPolicyString); | 225 const Value* value = policy_map.Get(test_policy_definitions::kPolicyString); |
| 226 EXPECT_TRUE(StringValue("hklm").Equals(value)); | 226 EXPECT_TRUE(StringValue("hklm").Equals(value)); |
| 227 } | 227 } |
| 228 | 228 |
| 229 } // namespace policy | 229 } // namespace policy |
| OLD | NEW |