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

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

Issue 2503273002: Fetch a warmup URL if data reduction proxy is enabled (Closed)
Patch Set: ps Created 4 years 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 716e02a17b9014a1b870ad1ad1b996b68fb11d63..70489bfcf90b09aafaa2de81b177d0cf8d2d21e6 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
@@ -377,20 +377,34 @@ TEST_F(DataReductionProxyParamsTest, QuicFieldTrial) {
bool expected_enabled;
std::string zero_rtt_param;
bool expected_zero_rtt;
+ bool enable_warmup_url;
+ bool expect_warmup_url_enabled;
+ bool set_warmup_url;
RyanSturm 2016/12/08 20:59:17 can you get rid of set_warmup_url and do an empty
tbansal1 2016/12/10 00:48:49 Done.
+ std::string warm_up_url;
RyanSturm 2016/12/08 20:59:17 s/warm_up_url/warmup_url/ or change the other vari
tbansal1 2016/12/10 00:48:49 Done.
} 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},
+ {"Enabled", true, "true", true, true, true, false, std::string()},
+ {"Enabled", true, "true", true, false, false, false, std::string()},
+ {"Enabled_Control", true, "true", true, true, true, false, std::string()},
+ {"Enabled_Control", true, "false", false, true, true, false,
+ std::string()},
+ {"Enabled_Control", true, std::string(), false, true, true, false,
+ std::string()},
+ {"Control", false, "true", false, true, true, false, std::string()},
+ {"Disabled", false, "false", false, true, false, false, std::string()},
+ {"enabled", false, "false", false, true, false, false, std::string()},
+ {"Enabled", true, "true", true, true, true, true,
+ "example.com/test.html"},
};
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;
+ if (test.enable_warmup_url)
+ variation_params["enable_warmup"] = "true";
+
+ if (test.set_warmup_url)
+ variation_params["warmup_url"] = test.warm_up_url;
ASSERT_TRUE(variations::AssociateVariationParams(
params::GetQuicFieldTrialName(), test.trial_group_name,
variation_params));
@@ -401,6 +415,13 @@ TEST_F(DataReductionProxyParamsTest, QuicFieldTrial) {
EXPECT_EQ(test.expected_enabled, params::IsIncludedInQuicFieldTrial());
EXPECT_EQ(test.expected_zero_rtt, params::IsZeroRttQuicEnabled());
+ if (test.set_warmup_url) {
+ EXPECT_EQ(GURL(test.warm_up_url), params::GetWarmupURL());
+ } else {
+ EXPECT_EQ(GURL("http://check.googlezip.net/generate_204"),
+ params::GetWarmupURL());
+ }
+ EXPECT_EQ(test.expect_warmup_url_enabled, params::FetchWarmupURLEnabled());
}
}

Powered by Google App Engine
This is Rietveld 408576698