OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/registry.h" | 10 #include "base/registry.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // with the thread executing the tests. | 142 // with the thread executing the tests. |
143 MessageLoop loop_; | 143 MessageLoop loop_; |
144 | 144 |
145 // Keys are created for the lifetime of a test to contain | 145 // Keys are created for the lifetime of a test to contain |
146 // the sandboxed HKCU and HKLM hives, respectively. | 146 // the sandboxed HKCU and HKLM hives, respectively. |
147 RegKey temp_hkcu_hive_key_; | 147 RegKey temp_hkcu_hive_key_; |
148 RegKey temp_hklm_hive_key_; | 148 RegKey temp_hklm_hive_key_; |
149 }; | 149 }; |
150 | 150 |
151 ConfigurationPolicyProviderWinTest::ConfigurationPolicyProviderWinTest() | 151 ConfigurationPolicyProviderWinTest::ConfigurationPolicyProviderWinTest() |
152 : temp_hklm_hive_key_(HKEY_CURRENT_USER, kUnitTestMachineOverrideSubKey), | 152 : temp_hklm_hive_key_(HKEY_CURRENT_USER, kUnitTestMachineOverrideSubKey, |
153 temp_hkcu_hive_key_(HKEY_CURRENT_USER, kUnitTestUserOverrideSubKey) { | 153 KEY_READ), |
| 154 temp_hkcu_hive_key_(HKEY_CURRENT_USER, kUnitTestUserOverrideSubKey, |
| 155 KEY_READ) { |
154 } | 156 } |
155 | 157 |
156 void ConfigurationPolicyProviderWinTest::SetUp() { | 158 void ConfigurationPolicyProviderWinTest::SetUp() { |
157 // Cleanup any remnants of previous tests. | 159 // Cleanup any remnants of previous tests. |
158 DeleteRegistrySandbox(); | 160 DeleteRegistrySandbox(); |
159 | 161 |
160 // Create the subkeys to hold the overridden HKLM and HKCU | 162 // Create the subkeys to hold the overridden HKLM and HKCU |
161 // policy settings. | 163 // policy settings. |
162 temp_hklm_hive_key_.Create(HKEY_CURRENT_USER, | 164 temp_hklm_hive_key_.Create(HKEY_CURRENT_USER, |
163 kUnitTestMachineOverrideSubKey, | 165 kUnitTestMachineOverrideSubKey, |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 | 415 |
414 TEST_F(ConfigurationPolicyProviderWinTest, | 416 TEST_F(ConfigurationPolicyProviderWinTest, |
415 TestPolicyMetricsReportingEnabled) { | 417 TestPolicyMetricsReportingEnabled) { |
416 TestBooleanPolicy(ConfigurationPolicyStore::kPolicyMetricsReportingEnabled); | 418 TestBooleanPolicy(ConfigurationPolicyStore::kPolicyMetricsReportingEnabled); |
417 } | 419 } |
418 | 420 |
419 TEST_F(ConfigurationPolicyProviderWinTest, | 421 TEST_F(ConfigurationPolicyProviderWinTest, |
420 TestPolicyPasswordManagerEnabled) { | 422 TestPolicyPasswordManagerEnabled) { |
421 TestBooleanPolicy(ConfigurationPolicyStore::kPolicyPasswordManagerEnabled); | 423 TestBooleanPolicy(ConfigurationPolicyStore::kPolicyPasswordManagerEnabled); |
422 } | 424 } |
OLD | NEW |