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

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

Issue 2566773002: Add Brotli to Accept Encoding header for secure DRP requests (Closed)
Patch Set: Fix test Created 4 years 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 e849b0df9f6ddd78e96dc648496a82c2af363a73..46a56f5b32bf160949ae2d511a37e9f9585c8254 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
@@ -193,6 +193,46 @@ TEST_F(DataReductionProxyParamsTest, IsClientConfigEnabled) {
}
}
+TEST_F(DataReductionProxyParamsTest, IsBrotliAcceptEncodingEnabled) {
+ 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(
+ "DataReductionProxyBrotliAcceptEncoding", test.trial_group_value));
+ }
+ EXPECT_EQ(test.expected, params::IsBrotliAcceptEncodingEnabled())
+ << test.test_case;
+ }
+}
+
TEST_F(DataReductionProxyParamsTest, AreServerExperimentsEnabled) {
const struct {
std::string test_case;
« 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