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

Unified Diff: components/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.cc

Issue 1849293002: Add kill switch for DRP config service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sclittle comment Created 4 years, 9 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 | « components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.cc
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.cc b/components/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.cc
index cbc77cd072dbdc591d9a7be23b32db8bd5931487..0c8aadafe624825003b7389c7d38a67d2693207e 100644
--- a/components/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.cc
+++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.cc
@@ -229,6 +229,45 @@ TEST_F(DataReductionProxyParamsTest, AndroidOnePromoFieldTrial) {
"google/hammerhead/hammerhead:5.0/LRX210/1570415:user/release-keys"));
}
+TEST_F(DataReductionProxyParamsTest, IsClientConfigEnabled) {
+ const struct {
+ std::string test_case;
+ std::string trial_group_value;
+ bool expected;
+ } tests[] = {
+ {
+ "Nothing set", "", true,
+ },
+ {
+ "Enabled in experiment", "Enabled", true,
+ },
+ {
+ "Alternate enabled in experiment", "Enabled_Other", true,
+ },
+ {
+ "Control in experiment", "Control", true,
+ },
+ {
+ "Disabled in experiment", "Disabled", false,
+ },
+ {
+ "Disabled in experiment", "Disabled_Other", false,
+ },
+ {
+ "disabled in experiment lower case", "disabled", true,
+ },
+ };
+
+ for (const auto& test : tests) {
+ base::FieldTrialList field_trial_list(nullptr);
+ if (!test.trial_group_value.empty()) {
+ ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
+ "DataReductionProxyConfigService", test.trial_group_value));
+ }
+ EXPECT_EQ(test.expected, params::IsConfigClientEnabled()) << test.test_case;
+ }
+}
+
TEST_F(DataReductionProxyParamsTest, SecureProxyCheckDefault) {
struct {
bool command_line_set;
@@ -268,9 +307,9 @@ TEST_F(DataReductionProxyParamsTest, SecureProxyCheckDefault) {
}
if (test_case.experiment_enabled) {
- base::FieldTrialList::CreateFieldTrial(
+ ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
"DataReductionProxySecureProxyAfterCheck",
- test_case.in_trial_group ? "Enabled" : "Disabled");
+ test_case.in_trial_group ? "Enabled" : "Disabled"));
}
EXPECT_EQ(test_case.expected_use_by_default,
« no previous file with comments | « components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698