Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Side by Side Diff: chrome/browser/policy/configuration_policy_provider_win_unittest.cc

Issue 8586030: Added ConfigurationPolicyProvider::RefreshPolicies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/policy/configuration_policy_provider_test.cc ('k') | chrome/browser/policy/configuration_policy_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698