| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "chrome/browser/io_thread.h" | 6 #include "chrome/browser/io_thread.h" |
| 7 #include "net/http/http_network_session.h" | 7 #include "net/http/http_network_session.h" |
| 8 #include "net/http/http_server_properties_impl.h" | 8 #include "net/http/http_server_properties_impl.h" |
| 9 #include "net/quic/quic_protocol.h" | 9 #include "net/quic/quic_protocol.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 EXPECT_TRUE(use_alternate_protocols); | 86 EXPECT_TRUE(use_alternate_protocols); |
| 87 } | 87 } |
| 88 | 88 |
| 89 TEST_F(IOThreadTest, SpdyFieldTrialSpdy4Enabled) { | 89 TEST_F(IOThreadTest, SpdyFieldTrialSpdy4Enabled) { |
| 90 bool use_alternate_protocols = false; | 90 bool use_alternate_protocols = false; |
| 91 IOThreadPeer::ConfigureSpdyFromTrial("Spdy4Enabled", &globals_); | 91 IOThreadPeer::ConfigureSpdyFromTrial("Spdy4Enabled", &globals_); |
| 92 EXPECT_THAT(globals_.next_protos, | 92 EXPECT_THAT(globals_.next_protos, |
| 93 ElementsAre(net::kProtoHTTP11, | 93 ElementsAre(net::kProtoHTTP11, |
| 94 net::kProtoQUIC1SPDY3, | 94 net::kProtoQUIC1SPDY3, |
| 95 net::kProtoSPDY31, | 95 net::kProtoSPDY31, |
| 96 net::kProtoSPDY4)); | 96 net::kProtoSPDY4_14, |
| 97 net::kProtoSPDY4_15)); |
| 97 globals_.use_alternate_protocols.CopyToIfSet(&use_alternate_protocols); | 98 globals_.use_alternate_protocols.CopyToIfSet(&use_alternate_protocols); |
| 98 EXPECT_TRUE(use_alternate_protocols); | 99 EXPECT_TRUE(use_alternate_protocols); |
| 99 } | 100 } |
| 100 | 101 |
| 101 TEST_F(IOThreadTest, SpdyFieldTrialSpdy4Control) { | 102 TEST_F(IOThreadTest, SpdyFieldTrialSpdy4Control) { |
| 102 bool use_alternate_protocols = false; | 103 bool use_alternate_protocols = false; |
| 103 IOThreadPeer::ConfigureSpdyFromTrial("Spdy4Control", &globals_); | 104 IOThreadPeer::ConfigureSpdyFromTrial("Spdy4Control", &globals_); |
| 104 EXPECT_THAT(globals_.next_protos, | 105 EXPECT_THAT(globals_.next_protos, |
| 105 ElementsAre(net::kProtoHTTP11, | 106 ElementsAre(net::kProtoHTTP11, |
| 106 net::kProtoQUIC1SPDY3, | 107 net::kProtoQUIC1SPDY3, |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 field_trial_group_ = "Enabled"; | 341 field_trial_group_ = "Enabled"; |
| 341 field_trial_params_["alternate_protocol_probability_threshold"] = ".5"; | 342 field_trial_params_["alternate_protocol_probability_threshold"] = ".5"; |
| 342 | 343 |
| 343 ConfigureQuicGlobals(); | 344 ConfigureQuicGlobals(); |
| 344 net::HttpNetworkSession::Params params; | 345 net::HttpNetworkSession::Params params; |
| 345 InitializeNetworkSessionParams(¶ms); | 346 InitializeNetworkSessionParams(¶ms); |
| 346 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold); | 347 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold); |
| 347 } | 348 } |
| 348 | 349 |
| 349 } // namespace test | 350 } // namespace test |
| OLD | NEW |