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 "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 Loading... |
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 Loading... |
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 |
OLD | NEW |