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

Unified Diff: chrome/browser/io_thread_unittest.cc

Issue 1580583002: Add a whitelist for QUIC hosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 4 years, 11 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
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/io_thread_unittest.cc
diff --git a/chrome/browser/io_thread_unittest.cc b/chrome/browser/io_thread_unittest.cc
index 9f0ee03ce9ff562256cf1c0b91bf3e4226160455..c1d23a319e5d663ec868fbc56a5e1b2f3b65628d 100644
--- a/chrome/browser/io_thread_unittest.cc
+++ b/chrome/browser/io_thread_unittest.cc
@@ -235,6 +235,7 @@ TEST_F(IOThreadTest, EnableQuicFromFieldTrialGroup) {
params.quic_idle_connection_timeout_seconds);
EXPECT_FALSE(params.quic_disable_preconnect_if_0rtt);
EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy());
+ EXPECT_TRUE(params.quic_host_whitelist.empty());
}
TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) {
@@ -568,6 +569,32 @@ TEST_F(IOThreadTest, AlternativeServiceProbabilityThresholdFromParams) {
EXPECT_EQ(.5, params.alternative_service_probability_threshold);
}
+TEST_F(IOThreadTest, QuicWhitelistFromCommandLinet) {
+ command_line_.AppendSwitch("enable-quic");
+ command_line_.AppendSwitchASCII("quic-host-whitelist",
+ "www.example.org, www.example.com");
+
+ ConfigureQuicGlobals();
+ net::HttpNetworkSession::Params params;
+ InitializeNetworkSessionParams(&params);
+ EXPECT_EQ(2u, params.quic_host_whitelist.size());
+ EXPECT_TRUE(ContainsKey(params.quic_host_whitelist, "www.example.org"));
+ EXPECT_TRUE(ContainsKey(params.quic_host_whitelist, "www.example.com"));
+}
+
+TEST_F(IOThreadTest, QuicWhitelistFromParams) {
+ field_trial_group_ = "Enabled";
+ field_trial_params_["quic_host_whitelist"] =
+ "www.example.org, www.example.com";
+
+ ConfigureQuicGlobals();
+ net::HttpNetworkSession::Params params;
+ InitializeNetworkSessionParams(&params);
+ EXPECT_EQ(2u, params.quic_host_whitelist.size());
+ EXPECT_TRUE(ContainsKey(params.quic_host_whitelist, "www.example.org"));
+ EXPECT_TRUE(ContainsKey(params.quic_host_whitelist, "www.example.com"));
+}
+
TEST_F(IOThreadTest, QuicDisallowedByPolicy) {
command_line_.AppendSwitch(switches::kEnableQuic);
is_quic_allowed_by_policy_ = false;
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698