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

Unified Diff: rlz/test/rlz_test_helpers.cc

Issue 2909943003: Removing useless Win7 checks + standardize its use (Closed)
Patch Set: Various nits Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/base/auto_thread_unittest.cc ('k') | sandbox/win/src/process_mitigations_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: rlz/test/rlz_test_helpers.cc
diff --git a/rlz/test/rlz_test_helpers.cc b/rlz/test/rlz_test_helpers.cc
index 2d4b6dd55e045e750c5d1f8f72acf4ea15ab9f6b..c8d5000a995a3a304dda328b15dcfc5945003d2f 100644
--- a/rlz/test/rlz_test_helpers.cc
+++ b/rlz/test/rlz_test_helpers.cc
@@ -20,7 +20,6 @@
#if defined(OS_WIN)
#include <shlwapi.h>
#include "base/win/registry.h"
-#include "base/win/windows_version.h"
#elif defined(OS_POSIX)
#include "base/files/file_path.h"
#include "rlz/lib/rlz_value_store.h"
@@ -100,31 +99,26 @@ void WriteRegistryTree(const RegistryKeyData& data, base::win::RegKey* dest) {
void InitializeRegistryOverridesForTesting(
registry_util::RegistryOverrideManager* override_manager) {
// For the moment, the HKCU hive requires no initialization.
- const bool do_copy = (base::win::GetVersion() >= base::win::VERSION_WIN7);
RegistryKeyData data;
- if (do_copy) {
- // Copy the following HKLM subtrees to the temporary location so that the
- // win32 APIs used by the tests continue to work:
- //
- // HKLM\System\CurrentControlSet\Control\Lsa\AccessProviders
- //
- // This seems to be required since Win7.
- ReadRegistryTree(base::win::RegKey(HKEY_LOCAL_MACHINE,
- kHKLMAccessProviders,
- KEY_READ), &data);
- }
+ // Copy the following HKLM subtrees to the temporary location so that the
+ // win32 APIs used by the tests continue to work:
+ //
+ // HKLM\System\CurrentControlSet\Control\Lsa\AccessProviders
+ //
+ // This seems to be required since Win7.
+ ReadRegistryTree(base::win::RegKey(HKEY_LOCAL_MACHINE,
+ kHKLMAccessProviders,
+ KEY_READ), &data);
ASSERT_NO_FATAL_FAILURE(
override_manager->OverrideRegistry(HKEY_LOCAL_MACHINE));
ASSERT_NO_FATAL_FAILURE(
override_manager->OverrideRegistry(HKEY_CURRENT_USER));
- if (do_copy) {
- base::win::RegKey key(
- HKEY_LOCAL_MACHINE, kHKLMAccessProviders, KEY_ALL_ACCESS);
- WriteRegistryTree(data, &key);
- }
+ base::win::RegKey key(
+ HKEY_LOCAL_MACHINE, kHKLMAccessProviders, KEY_ALL_ACCESS);
+ WriteRegistryTree(data, &key);
}
} // namespace
« no previous file with comments | « remoting/base/auto_thread_unittest.cc ('k') | sandbox/win/src/process_mitigations_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698