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

Unified Diff: chrome_elf/blacklist/test/blacklist_test.cc

Issue 2345913003: [chrome_elf] NTRegistry - added wow64 redirection support. (Closed)
Patch Set: Final nits. Created 4 years, 2 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 | « chrome_elf/BUILD.gn ('k') | chrome_elf/blacklist/test/blacklist_test_main_dll.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_elf/blacklist/test/blacklist_test.cc
diff --git a/chrome_elf/blacklist/test/blacklist_test.cc b/chrome_elf/blacklist/test/blacklist_test.cc
index b970057e0d767dc8104e5f87a5c6842fecc0fef7..16ce917492ed209211dbd55b959b982c3eb55820 100644
--- a/chrome_elf/blacklist/test/blacklist_test.cc
+++ b/chrome_elf/blacklist/test/blacklist_test.cc
@@ -133,20 +133,18 @@ class BlacklistTest : public testing::Test {
// process-specific environment variables, for our test DLLs to access.
// This will only work as long as the IPC is within the same process.
void IpcOverrides() {
- if (::wcslen(nt::HKCU_override) != 0) {
- ASSERT_TRUE(
- ::SetEnvironmentVariableW(L"hkcu_override", nt::HKCU_override));
- }
- if (::wcslen(nt::HKLM_override) != 0) {
- ASSERT_TRUE(
- ::SetEnvironmentVariableW(L"hklm_override", nt::HKLM_override));
- }
+ base::string16 temp = nt::GetTestingOverride(nt::HKCU);
+ if (!temp.empty())
+ ASSERT_TRUE(::SetEnvironmentVariableW(L"hkcu_override", temp.c_str()));
+ temp = nt::GetTestingOverride(nt::HKLM);
+ if (!temp.empty())
+ ASSERT_TRUE(::SetEnvironmentVariableW(L"hklm_override", temp.c_str()));
}
void SetUp() override {
base::string16 temp;
override_manager_.OverrideRegistry(HKEY_CURRENT_USER, &temp);
- ::wcsncpy(nt::HKCU_override, temp.c_str(), nt::g_kRegMaxPathLen - 1);
+ ASSERT_TRUE(nt::SetTestingOverride(nt::HKCU, temp));
// Make the override path available to our test DLL.
IpcOverrides();
@@ -203,10 +201,9 @@ class BlacklistTest : public testing::Test {
TestDll_RemoveDllFromBlacklist(kTestDllName1);
TestDll_RemoveDllFromBlacklist(kTestDllName2);
TestDll_RemoveDllFromBlacklist(kTestDllName3);
- }
- // A scoped temporary directory to be destroyed with this test.
- base::ScopedTempDir reg_override_dir_;
+ ASSERT_TRUE(nt::SetTestingOverride(nt::HKCU, base::string16()));
+ }
};
TEST_F(BlacklistTest, Beacon) {
« no previous file with comments | « chrome_elf/BUILD.gn ('k') | chrome_elf/blacklist/test/blacklist_test_main_dll.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698