| Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc
|
| diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc
|
| index a9c9322baeb9a6f184c7c2c2e807b91c148eb595..0f1e493b2b0017336c5f9124821bdbb6324cd67e 100644
|
| --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc
|
| +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc
|
| @@ -665,8 +665,31 @@ TEST_F(DataReductionProxySettingsTest, CheckInitMetricsWhenNotAllowed) {
|
| }
|
|
|
| TEST_F(DataReductionProxySettingsTest, CheckQUICFieldTrials) {
|
| - for (int i = 0; i < 2; ++i) {
|
| - bool enable_quic = i == 0;
|
| + const struct {
|
| + bool enable_quic;
|
| + std::string field_trial_group_name;
|
| + } tests[] = {
|
| + {
|
| + false, std::string(),
|
| + },
|
| + {
|
| + true, "Enabled",
|
| + },
|
| + {
|
| + true, "EnabledControl",
|
| + },
|
| + {
|
| + false, "NotEnabled",
|
| + },
|
| + {
|
| + false, "Control",
|
| + },
|
| + {
|
| + false, "Disabled",
|
| + },
|
| + };
|
| +
|
| + for (size_t i = 0; i < arraysize(tests); ++i) {
|
| // No call to |AddProxyToCommandLine()| was made, so the proxy feature
|
| // should be unavailable.
|
| // Clear the command line. Setting flags can force the proxy to be allowed.
|
| @@ -682,14 +705,10 @@ TEST_F(DataReductionProxySettingsTest, CheckQUICFieldTrials) {
|
| test_context_->CreateDataReductionProxyService(settings_.get()));
|
|
|
| base::FieldTrialList field_trial_list(new base::MockEntropyProvider());
|
| - if (enable_quic) {
|
| - base::FieldTrialList::CreateFieldTrial(params::GetQuicFieldTrialName(),
|
| - "Enabled");
|
| - } else {
|
| - base::FieldTrialList::CreateFieldTrial(params::GetQuicFieldTrialName(),
|
| - "Disabled");
|
| - }
|
| - test_context_->config()->EnableQuic(enable_quic);
|
| +
|
| + base::FieldTrialList::CreateFieldTrial(params::GetQuicFieldTrialName(),
|
| + tests[i].field_trial_group_name);
|
| + test_context_->config()->EnableQuic(tests[i].enable_quic);
|
|
|
| settings_->SetCallbackToRegisterSyntheticFieldTrial(
|
| base::Bind(&DataReductionProxySettingsTestBase::
|
| @@ -698,7 +717,7 @@ TEST_F(DataReductionProxySettingsTest, CheckQUICFieldTrials) {
|
|
|
| net::ProxyServer origin =
|
| test_context_->config()->test_params()->proxies_for_http().front();
|
| - EXPECT_EQ(enable_quic, origin.is_quic()) << i;
|
| + EXPECT_EQ(tests[i].enable_quic, origin.is_quic()) << i;
|
| }
|
| }
|
|
|
|
|