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

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

Issue 2869863002: Enable QUIC for non core data saver proxies (Closed)
Patch Set: Reorder functions Created 3 years, 7 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: 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 93113e0daf7d5b0084abb872b08a0546df9249e6..0c9833288070be733feb41920aec9484fdd10bf4 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
@@ -449,6 +449,44 @@ TEST_F(DataReductionProxyParamsTest, QuicFieldTrial) {
}
}
+// Tests if the QUIC field trial |enable_quic_non_core_proxies| is set
+// correctly.
+TEST_F(DataReductionProxyParamsTest, QuicEnableNonCoreProxies) {
+ const struct {
+ std::string trial_group_name;
+ bool expected_enabled;
+ std::string enable_non_core_proxies;
+ bool expected_enable_non_core_proxies;
+ } tests[] = {
+ {"Enabled", true, "true", true},
+ {"Enabled", true, "false", false},
+ {"Enabled", true, std::string(), false},
+ {"Control", false, "true", false},
+ {"Disabled", false, "true", false},
+ };
+
+ for (const auto& test : tests) {
+ variations::testing::ClearAllVariationParams();
+ std::map<std::string, std::string> variation_params;
+ variation_params["enable_quic_non_core_proxies"] =
+ test.enable_non_core_proxies;
+
+ ASSERT_TRUE(variations::AssociateVariationParams(
+ params::GetQuicFieldTrialName(), test.trial_group_name,
+ variation_params));
+
+ base::FieldTrialList field_trial_list(nullptr);
+ base::FieldTrialList::CreateFieldTrial(params::GetQuicFieldTrialName(),
+ test.trial_group_name);
+
+ EXPECT_EQ(test.expected_enabled, params::IsIncludedInQuicFieldTrial());
+ if (params::IsIncludedInQuicFieldTrial()) {
+ EXPECT_EQ(test.expected_enable_non_core_proxies,
+ params::IsQuicEnabledForNonCoreProxies());
+ }
+ }
+}
+
TEST_F(DataReductionProxyParamsTest, HoldbackEnabledFieldTrial) {
const struct {
std::string trial_group_name;

Powered by Google App Engine
This is Rietveld 408576698