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

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: megjablon comments 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 20de8115b95cd6b93244e300ae069df368255393..7f6a5ce9add810272417f4d717a89727e326b318 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
@@ -456,6 +456,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", true},
megjablon 2017/05/10 23:11:24 Shouldn't this case not happen since IsIncludedInQ
tbansal1 2017/05/11 01:29:28 Right. When QUIC is not enabled, behavior of IsQui
+ {"Disabled", false, "false", 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::IsQuicForNonCoreProxiesEnabled());
+ }
+ }
+}
+
TEST_F(DataReductionProxyParamsTest, HoldbackEnabledFieldTrial) {
const struct {
std::string trial_group_name;

Powered by Google App Engine
This is Rietveld 408576698