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

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

Issue 2345913003: [chrome_elf] NTRegistry - added wow64 redirection support. (Closed)
Patch Set: Code review fixes, part 4. Created 4 years, 3 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
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..993b4cfca4a7589e92ee2868b26213160ca5f14e 100644
--- a/chrome_elf/blacklist/test/blacklist_test.cc
+++ b/chrome_elf/blacklist/test/blacklist_test.cc
@@ -133,20 +133,19 @@ 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;
grt (UTC plus 2) 2016/10/02 20:10:54 nit: base::string16 temp = nt::GetTestingOverr
penny 2016/10/03 19:18:48 Done.
+ temp = nt::GetTestingOverride(nt::HKCU);
+ if (temp.length() != 0)
grt (UTC plus 2) 2016/10/02 20:10:54 nit: if (!temp.empty()) below, too
penny 2016/10/03 19:18:48 Done.
+ ASSERT_TRUE(::SetEnvironmentVariableW(L"hkcu_override", temp.c_str()));
+ temp = nt::GetTestingOverride(nt::HKLM);
+ if (temp.length() != 0)
+ 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 +202,10 @@ 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_;
+ base::string16 temp;
+ ASSERT_TRUE(nt::SetTestingOverride(nt::HKCU, temp));
grt (UTC plus 2) 2016/10/02 20:10:54 nit: ASSERT_TRUE(nt::SetTestingOverride(nt::HK
penny 2016/10/03 19:18:48 Done.
+ }
};
TEST_F(BlacklistTest, Beacon) {

Powered by Google App Engine
This is Rietveld 408576698