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

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

Issue 12314090: Add utf_string_conversions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months 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) 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/process.h" 10 #include "base/process.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 255
256 ScopedGroupPolicyRegistrySandbox registry_sandbox_; 256 ScopedGroupPolicyRegistrySandbox registry_sandbox_;
257 257
258 DISALLOW_COPY_AND_ASSIGN(TestHarness); 258 DISALLOW_COPY_AND_ASSIGN(TestHarness);
259 }; 259 };
260 260
261 ScopedGroupPolicyRegistrySandbox::ScopedGroupPolicyRegistrySandbox() { 261 ScopedGroupPolicyRegistrySandbox::ScopedGroupPolicyRegistrySandbox() {
262 // Generate a unique registry key for the override for each test. This 262 // Generate a unique registry key for the override for each test. This
263 // makes sure that tests executing in parallel won't delete each other's 263 // makes sure that tests executing in parallel won't delete each other's
264 // key, at DeleteKeys(). 264 // key, at DeleteKeys().
265 key_name_ = ASCIIToWide(base::StringPrintf( 265 key_name_ = base::ASCIIToWide(base::StringPrintf(
266 "SOFTWARE\\chromium unittest %d", 266 "SOFTWARE\\chromium unittest %d",
267 base::Process::Current().pid())); 267 base::Process::Current().pid()));
268 std::wstring hklm_key_name = key_name_ + L"\\HKLM"; 268 std::wstring hklm_key_name = key_name_ + L"\\HKLM";
269 std::wstring hkcu_key_name = key_name_ + L"\\HKCU"; 269 std::wstring hkcu_key_name = key_name_ + L"\\HKCU";
270 270
271 // Create the subkeys to hold the overridden HKLM and HKCU 271 // Create the subkeys to hold the overridden HKLM and HKCU
272 // policy settings. 272 // policy settings.
273 temp_hklm_hive_key_.Create(HKEY_CURRENT_USER, 273 temp_hklm_hive_key_.Create(HKEY_CURRENT_USER,
274 hklm_key_name.c_str(), 274 hklm_key_name.c_str(),
275 KEY_ALL_ACCESS); 275 KEY_ALL_ACCESS);
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 expected_policy.SetInteger("special-int2", -456); 626 expected_policy.SetInteger("special-int2", -456);
627 expected_policy.SetDouble("double1", 789.0); 627 expected_policy.SetDouble("double1", 789.0);
628 expected_policy.SetDouble("double2", 123.456e7); 628 expected_policy.SetDouble("double2", 123.456e7);
629 PolicyBundle expected; 629 PolicyBundle expected;
630 expected.Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, "test")) 630 expected.Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, "test"))
631 .LoadFrom(&expected_policy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER); 631 .LoadFrom(&expected_policy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER);
632 EXPECT_TRUE(Matches(expected)); 632 EXPECT_TRUE(Matches(expected));
633 } 633 }
634 634
635 } // namespace policy 635 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/browser_policy_connector.cc ('k') | chrome/browser/policy/policy_path_parser_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698