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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc

Issue 1354283002: Use QUIC for DRP if field trial group starts with Enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 3 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/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..2c1b10dec2625e40c6eef9189980e3a012843875 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(),
+ },
+ {
+ false, "NotEnabled",
+ },
+ {
+ false, "Control",
+ },
+ {
+ false, "Disabled",
+ },
+ {
+ true, "EnabledControl",
+ },
+ {
+ true, "Enabled",
+ },
+ };
+
+ 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,23 +705,22 @@ 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);
+ EXPECT_EQ(
+ tests[i].field_trial_group_name,
+ base::FieldTrialList::FindFullName(params::GetQuicFieldTrialName()));
+ test_context_->config()->EnableQuic(tests[i].enable_quic);
settings_->SetCallbackToRegisterSyntheticFieldTrial(
base::Bind(&DataReductionProxySettingsTestBase::
- SyntheticFieldTrialRegistrationCallback,
+ SyntheticFieldTrialRegistrationCallback,
base::Unretained(this)));
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;
}
}
« no previous file with comments | « chrome/browser/io_thread_unittest.cc ('k') | components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698