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..ba7255573e5ce719d8e70c930bd66d2add07a3b4 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,45 @@ 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_Control", true, "true", true}, |
megjablon
2017/05/09 18:16:22
What is the difference between "Enabled_Control" v
tbansal1
2017/05/09 23:57:41
I just removed them to avoid confusion since that
|
+ {"Enabled_Control", true, "false", false}, |
+ {"Enabled_Control", true, std::string(), false}, |
+ {"Control", false, "true", true}, |
+ {"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; |