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; |