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

Unified Diff: chrome/browser/win/chrome_elf_init_unittest.cc

Issue 1841573002: [Chrome ELF] New NT registry API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: PRESUBMIT to allow chrome_elf directory files to use wstring. Created 4 years, 5 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/browser/win/chrome_elf_init.cc ('k') | chrome/chrome_installer.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/win/chrome_elf_init_unittest.cc
diff --git a/chrome/browser/win/chrome_elf_init_unittest.cc b/chrome/browser/win/chrome_elf_init_unittest.cc
index 46171f5a9db3dfa18b0cb8d3c8cd09d5e40cd6f8..3c23e4929eddec321a6f11d190526afc9b021f44 100644
--- a/chrome/browser/win/chrome_elf_init_unittest.cc
+++ b/chrome/browser/win/chrome_elf_init_unittest.cc
@@ -166,8 +166,9 @@ TEST_F(ChromeBlacklistTrialTest, AddFinchBlacklistToRegistry) {
// Set up the trial with the desired parameters.
std::map<std::string, std::string> desired_params;
- desired_params["TestDllName1"] = "TestDll1.dll";
- desired_params["TestDllName2"] = "TestDll2.dll";
+
+ desired_params[blacklist::kRegistryFinchListValueNameStr] =
+ "TestDll1.dll,TestDll2.dll";
variations::AssociateVariationParams(
kBrowserBlacklistTrialName,
@@ -177,21 +178,23 @@ TEST_F(ChromeBlacklistTrialTest, AddFinchBlacklistToRegistry) {
// This should add the dlls in those parameters to the registry.
AddFinchBlacklistToRegistry();
- // Check that all the values in desired_params were added to the registry.
+ // Check that all the dll names in desired_params were added to the registry.
+ std::vector<std::wstring> dlls;
+
base::win::RegKey finch_blacklist_registry_key(
HKEY_CURRENT_USER,
blacklist::kRegistryFinchListPath,
KEY_QUERY_VALUE | KEY_SET_VALUE);
- ASSERT_EQ(desired_params.size(),
- finch_blacklist_registry_key.GetValueCount());
+ ASSERT_TRUE(finch_blacklist_registry_key.HasValue(
+ blacklist::kRegistryFinchListValueName));
+ ASSERT_EQ(ERROR_SUCCESS, finch_blacklist_registry_key.ReadValues(
+ blacklist::kRegistryFinchListValueName, &dlls));
- for (std::map<std::string, std::string>::iterator it = desired_params.begin();
- it != desired_params.end();
- ++it) {
- std::wstring name = base::UTF8ToWide(it->first);
- ASSERT_TRUE(finch_blacklist_registry_key.HasValue(name.c_str()));
- }
+ ASSERT_EQ((size_t)2,
+ /* Number of dll names passed in this test. */ dlls.size());
+ EXPECT_STREQ(L"TestDll1.dll", dlls[0].c_str());
+ EXPECT_STREQ(L"TestDll2.dll", dlls[1].c_str());
}
} // namespace
« no previous file with comments | « chrome/browser/win/chrome_elf_init.cc ('k') | chrome/chrome_installer.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698