| Index: chrome/browser/io_thread_unittest.cc
|
| diff --git a/chrome/browser/io_thread_unittest.cc b/chrome/browser/io_thread_unittest.cc
|
| index cb6e64984a9199046777dca52fdedd40e0cd0e80..bcb893defffa7fe0cb2c1f4d8bb2042fb147ab24 100644
|
| --- a/chrome/browser/io_thread_unittest.cc
|
| +++ b/chrome/browser/io_thread_unittest.cc
|
| @@ -5,6 +5,7 @@
|
| #include "base/command_line.h"
|
| #include "base/metrics/field_trial.h"
|
| #include "chrome/browser/io_thread.h"
|
| +#include "chrome/common/chrome_switches.h"
|
| #include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
|
| #include "net/http/http_network_session.h"
|
| #include "net/http/http_server_properties_impl.h"
|
| @@ -32,9 +33,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(
|
| @@ -55,13 +58,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() {
|
| @@ -76,6 +84,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_;
|
| };
|
|
|
| @@ -475,4 +484,14 @@ TEST_F(IOThreadTest,
|
| EXPECT_EQ(.5, params.alternate_protocol_probability_threshold);
|
| }
|
|
|
| +TEST_F(IOThreadTest, QuicDisallowedByPolicy) {
|
| + command_line_.AppendSwitch(switches::kEnableQuic);
|
| + is_quic_allowed_by_policy_ = false;
|
| + ConfigureQuicGlobals();
|
| +
|
| + net::HttpNetworkSession::Params params;
|
| + InitializeNetworkSessionParams(¶ms);
|
| + EXPECT_FALSE(params.enable_quic);
|
| +}
|
| +
|
| } // namespace test
|
|
|