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

Unified Diff: components/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.cc

Issue 2453973003: Add a QUIC proxy server to the list of QUIC servers supported at start up (Closed)
Patch Set: Created 4 years, 2 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 548fd351874c9246d234f958c34e14685bb6c1a1..412e09555eb111ba2c10c75a71ef1fd21a150f52 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
@@ -421,6 +421,40 @@ TEST_F(DataReductionProxyParamsTest, LoFiPreviewFieldTrial) {
}
}
+// Tests if the QUIC field trial is set correctly.
+TEST_F(DataReductionProxyParamsTest, QuicFieldTrial) {
+ const struct {
+ std::string trial_group_name;
+ bool expected_enabled;
+ std::string zero_rtt_param;
+ bool expected_zero_rtt;
+ } tests[] = {
+ {"Enabled", true, "true", true},
+ {"Enabled_Control", true, "true", true},
+ {"Enabled_Control", true, "false", false},
+ {"Enabled_Control", true, std::string(), false},
+ {"Control", false, "true", false},
+ {"Disabled", false, "false", false},
+ {"enabled", false, "false", false},
+ };
+
+ for (const auto& test : tests) {
+ variations::testing::ClearAllVariationParams();
+ std::map<std::string, std::string> variation_params;
+ variation_params["enable_zero_rtt"] = test.zero_rtt_param;
+ 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());
+ EXPECT_EQ(test.expected_zero_rtt, params::IsZeroRttQuicEnabled());
+ }
+}
+
TEST_F(DataReductionProxyParamsTest, HoldbackEnabledFieldTrial) {
const struct {
std::string trial_group_name;
« no previous file with comments | « components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc ('k') | net/base/proxy_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698