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

Unified Diff: chrome/browser/chrome_elf_init_unittest_win.cc

Issue 300933002: Finch Blacklist is now added to the Hardcoded blacklist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final changes? Created 6 years, 6 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 | « no previous file | chrome/browser/chrome_elf_init_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_elf_init_unittest_win.cc
diff --git a/chrome/browser/chrome_elf_init_unittest_win.cc b/chrome/browser/chrome_elf_init_unittest_win.cc
index 441f73665707f1f8dbc3bddc08729fb3ef70f91c..f98ee0817adce1a179da65ecee6fa9bd796184ed 100644
--- a/chrome/browser/chrome_elf_init_unittest_win.cc
+++ b/chrome/browser/chrome_elf_init_unittest_win.cc
@@ -14,9 +14,14 @@
#include "chrome/common/chrome_version_info.h"
#include "chrome_elf/chrome_elf_constants.h"
#include "components/variations/entropy_provider.h"
+#include "components/variations/variations_associated_data.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "version.h" // NOLINT
+namespace {
+
+const char kBrowserBlacklistTrialEnabledGroupName[] = "Enabled";
+
class ChromeBlacklistTrialTest : public testing::Test {
protected:
ChromeBlacklistTrialTest() {}
@@ -76,7 +81,6 @@ TEST_F(ChromeBlacklistTrialTest, DefaultRun) {
ASSERT_EQ(version, GetBlacklistVersion());
}
-
// Ensure that the blacklist is disabled for any users in the
// "BlacklistDisabled" finch group.
TEST_F(ChromeBlacklistTrialTest, BlacklistDisabledRun) {
@@ -172,3 +176,43 @@ TEST_F(ChromeBlacklistTrialTest, VersionChanged) {
base::string16 expected_version(base::UTF8ToUTF16(version_info.Version()));
ASSERT_EQ(expected_version, GetBlacklistVersion());
}
+
+TEST_F(ChromeBlacklistTrialTest, AddFinchBlacklistToRegistry) {
+ // Create the field trial with the blacklist enabled group.
+ base::FieldTrialList field_trial_list(
+ new metrics::SHA1EntropyProvider("test"));
+
+ scoped_refptr<base::FieldTrial> trial(base::FieldTrialList::CreateFieldTrial(
+ kBrowserBlacklistTrialName, kBrowserBlacklistTrialEnabledGroupName));
+
+ // 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";
+
+ chrome_variations::AssociateVariationParams(
+ kBrowserBlacklistTrialName,
+ kBrowserBlacklistTrialEnabledGroupName,
+ desired_params);
+
+ // 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.
+ 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());
+
+ 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()));
+ }
+}
+
+} // namespace
« no previous file with comments | « no previous file | chrome/browser/chrome_elf_init_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698