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

Unified Diff: chrome/browser/io_thread_unittest.cc

Issue 998383002: Created policy QuicAllowed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/browser/policy/policy_network_browsertest.cc » ('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 33bde3d841801dc4491ac268c3b7b064fa933008..bdc84855efc91b5dfe7da543f6e5d4d4cec101eb 100644
--- a/chrome/browser/io_thread_unittest.cc
+++ b/chrome/browser/io_thread_unittest.cc
@@ -32,9 +32,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 InitializeNetworkSessionParamsFromGlobals(
@@ -51,13 +53,17 @@ 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) {
Ryan Hamilton 2015/03/20 18:21:58 Can you wrap the : command_line_(...) onto the nex
peletskyi 2015/03/23 10:03:18 Done.
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 InitializeNetworkSessionParams(net::HttpNetworkSession::Params* params) {
@@ -67,6 +73,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_;
};
@@ -368,4 +375,14 @@ TEST_F(IOThreadTest,
EXPECT_EQ(.5, params.alternate_protocol_probability_threshold);
}
+TEST_F(IOThreadTest, QuicDisallowedByPolicy) {
+ command_line_.AppendSwitch("enable-quic");
+ is_quic_allowed_by_policy_ = false;
+ ConfigureQuicGlobals();
+
+ net::HttpNetworkSession::Params params;
+ InitializeNetworkSessionParams(&params);
+ EXPECT_FALSE(params.enable_quic);
+}
+
} // namespace test
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/browser/policy/policy_network_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698