Chromium Code Reviews| Index: chrome/browser/io_thread_unittest.cc |
| diff --git a/chrome/browser/io_thread_unittest.cc b/chrome/browser/io_thread_unittest.cc |
| index f2820d905e3e40a7dc8273b49f7a5d311967af99..b8cf337333c43e585a4cc0465c8af3aa76489577 100644 |
| --- a/chrome/browser/io_thread_unittest.cc |
| +++ b/chrome/browser/io_thread_unittest.cc |
| @@ -23,9 +23,11 @@ class IOThreadPeer { |
| const base::CommandLine& command_line, |
| base::StringPiece quic_trial_group, |
| const std::map<std::string, std::string>& quic_trial_params, |
| + bool is_quic_allowed_by_policy, |
| IOThread::Globals* globals) { |
| IOThread::ConfigureQuicGlobals(command_line, quic_trial_group, |
| - quic_trial_params, globals); |
| + quic_trial_params, is_quic_allowed_by_policy, |
| + globals); |
| } |
| static void ConfigureSpdyGlobals( |
| @@ -46,13 +48,18 @@ class IOThreadPeer { |
| class IOThreadTest : public testing::Test { |
| public: |
| - IOThreadTest() : command_line_(base::CommandLine::NO_PROGRAM) { |
| + IOThreadTest() |
| + : command_line_(base::CommandLine::NO_PROGRAM), |
| + is_quic_allowed_by_policy_(true) { |
| globals_.http_server_properties.reset(new net::HttpServerPropertiesImpl()); |
| } |
| void ConfigureQuicGlobals() { |
| - IOThreadPeer::ConfigureQuicGlobals(command_line_, field_trial_group_, |
| - field_trial_params_, &globals_); |
| + IOThreadPeer::ConfigureQuicGlobals(command_line_, |
| + field_trial_group_, |
| + field_trial_params_, |
| + is_quic_allowed_by_policy_, |
| + &globals_); |
| } |
| void ConfigureSpdyGlobals() { |
| @@ -67,6 +74,7 @@ class IOThreadTest : public testing::Test { |
| base::CommandLine command_line_; |
| IOThread::Globals globals_; |
| std::string field_trial_group_; |
| + bool is_quic_allowed_by_policy_; |
| std::map<std::string, std::string> field_trial_params_; |
| }; |
| @@ -453,4 +461,14 @@ TEST_F(IOThreadTest, |
| EXPECT_EQ(.5, params.alternate_protocol_probability_threshold); |
| } |
| +TEST_F(IOThreadTest, QuicDisallowedByPolicy) { |
| + command_line_.AppendSwitch("enable-quic"); |
|
Andrew T Wilson (Slow)
2015/04/30 15:04:15
use kEnableQuic here?
|
| + is_quic_allowed_by_policy_ = false; |
| + ConfigureQuicGlobals(); |
| + |
| + net::HttpNetworkSession::Params params; |
| + InitializeNetworkSessionParams(¶ms); |
| + EXPECT_FALSE(params.enable_quic); |
| +} |
| + |
| } // namespace test |