| OLD | NEW |
| 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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 temp_hklm_hive_key_.Create(HKEY_CURRENT_USER, | 186 temp_hklm_hive_key_.Create(HKEY_CURRENT_USER, |
| 187 kUnitTestMachineOverrideSubKey, | 187 kUnitTestMachineOverrideSubKey, |
| 188 KEY_ALL_ACCESS); | 188 KEY_ALL_ACCESS); |
| 189 temp_hkcu_hive_key_.Create(HKEY_CURRENT_USER, | 189 temp_hkcu_hive_key_.Create(HKEY_CURRENT_USER, |
| 190 kUnitTestUserOverrideSubKey, | 190 kUnitTestUserOverrideSubKey, |
| 191 KEY_ALL_ACCESS); | 191 KEY_ALL_ACCESS); |
| 192 | 192 |
| 193 ActivateOverrides(); | 193 ActivateOverrides(); |
| 194 | 194 |
| 195 provider_.reset(new ConfigurationPolicyProviderWin( | 195 provider_.reset(new ConfigurationPolicyProviderWin( |
| 196 ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList())); | 196 GetChromePolicyDefinitionList())); |
| 197 } | 197 } |
| 198 | 198 |
| 199 void ConfigurationPolicyProviderWinTest::TearDown() { | 199 void ConfigurationPolicyProviderWinTest::TearDown() { |
| 200 DeactivateOverrides(); | 200 DeactivateOverrides(); |
| 201 DeleteRegistrySandbox(); | 201 DeleteRegistrySandbox(); |
| 202 loop_.RunAllPending(); | 202 loop_.RunAllPending(); |
| 203 } | 203 } |
| 204 | 204 |
| 205 void ConfigurationPolicyProviderWinTest::ActivateOverrides() { | 205 void ConfigurationPolicyProviderWinTest::ActivateOverrides() { |
| 206 HRESULT result = RegOverridePredefKey(HKEY_LOCAL_MACHINE, | 206 HRESULT result = RegOverridePredefKey(HKEY_LOCAL_MACHINE, |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 ConfigurationPolicyProviderWinTest, | 518 ConfigurationPolicyProviderWinTest, |
| 519 testing::Values( | 519 testing::Values( |
| 520 PolicyTestParams::ForListPolicy( | 520 PolicyTestParams::ForListPolicy( |
| 521 kPolicyURLBlacklist, | 521 kPolicyURLBlacklist, |
| 522 key::kURLBlacklist), | 522 key::kURLBlacklist), |
| 523 PolicyTestParams::ForListPolicy( | 523 PolicyTestParams::ForListPolicy( |
| 524 kPolicyURLWhitelist, | 524 kPolicyURLWhitelist, |
| 525 key::kURLWhitelist))); | 525 key::kURLWhitelist))); |
| 526 | 526 |
| 527 } // namespace policy | 527 } // namespace policy |
| OLD | NEW |