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

Side by Side Diff: components/policy/core/common/policy_loader_win_unittest.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 "components/policy/core/common/policy_loader_win.h" 5 #include "components/policy/core/common/policy_loader_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <userenv.h> 8 #include <userenv.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 461
462 PRegTestHarness::PRegTestHarness() 462 PRegTestHarness::PRegTestHarness()
463 : PolicyProviderTestHarness(POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE) {} 463 : PolicyProviderTestHarness(POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE) {}
464 464
465 PRegTestHarness::~PRegTestHarness() {} 465 PRegTestHarness::~PRegTestHarness() {}
466 466
467 void PRegTestHarness::SetUp() { 467 void PRegTestHarness::SetUp() {
468 base::win::SetDomainStateForTesting(false); 468 base::win::SetDomainStateForTesting(false);
469 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 469 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
470 preg_file_path_ = temp_dir_.path().Append(PolicyLoaderWin::kPRegFileName); 470 preg_file_path_ = temp_dir_.path().Append(PolicyLoaderWin::kPRegFileName);
471 ASSERT_TRUE(file_util::WriteFile(preg_file_path_, 471 ASSERT_TRUE(base::WriteFile(preg_file_path_,
472 preg_parser::kPRegFileHeader, 472 preg_parser::kPRegFileHeader,
473 arraysize(preg_parser::kPRegFileHeader))); 473 arraysize(preg_parser::kPRegFileHeader)));
474 474
475 memset(&gpo_, 0, sizeof(GROUP_POLICY_OBJECT)); 475 memset(&gpo_, 0, sizeof(GROUP_POLICY_OBJECT));
476 gpo_.lpFileSysPath = const_cast<wchar_t*>(temp_dir_.path().value().c_str()); 476 gpo_.lpFileSysPath = const_cast<wchar_t*>(temp_dir_.path().value().c_str());
477 } 477 }
478 478
479 ConfigurationPolicyProvider* PRegTestHarness::CreateProvider( 479 ConfigurationPolicyProvider* PRegTestHarness::CreateProvider(
480 SchemaRegistry* registry, 480 SchemaRegistry* registry,
481 scoped_refptr<base::SequencedTaskRunner> task_runner) { 481 scoped_refptr<base::SequencedTaskRunner> task_runner) {
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 PolicyMap& expected_policy = expected.Get(ns); 1197 PolicyMap& expected_policy = expected.Get(ns);
1198 expected_policy.Set("alternative_browser_path", 1198 expected_policy.Set("alternative_browser_path",
1199 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, 1199 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
1200 new base::StringValue("c:\\legacy\\browser.exe"), NULL); 1200 new base::StringValue("c:\\legacy\\browser.exe"), NULL);
1201 expected_policy.Set("url_list", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, 1201 expected_policy.Set("url_list", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
1202 list.DeepCopy(), NULL); 1202 list.DeepCopy(), NULL);
1203 EXPECT_TRUE(Matches(expected)); 1203 EXPECT_TRUE(Matches(expected));
1204 } 1204 }
1205 1205
1206 } // namespace policy 1206 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698