| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 } | 277 } |
| 278 | 278 |
| 279 void AddQuicAlternateProtocolMapping( | 279 void AddQuicAlternateProtocolMapping( |
| 280 MockCryptoClientStream::HandshakeMode handshake_mode) { | 280 MockCryptoClientStream::HandshakeMode handshake_mode) { |
| 281 crypto_client_stream_factory_.set_handshake_mode(handshake_mode); | 281 crypto_client_stream_factory_.set_handshake_mode(handshake_mode); |
| 282 session_->http_server_properties()->SetAlternateProtocol( | 282 session_->http_server_properties()->SetAlternateProtocol( |
| 283 HostPortPair::FromURL(request_.url), 80, QUIC, 1); | 283 HostPortPair::FromURL(request_.url), 80, QUIC, 1); |
| 284 } | 284 } |
| 285 | 285 |
| 286 void ExpectBrokenAlternateProtocolMapping() { | 286 void ExpectBrokenAlternateProtocolMapping() { |
| 287 ASSERT_TRUE(session_->http_server_properties()->HasAlternateProtocol( | |
| 288 HostPortPair::FromURL(request_.url))); | |
| 289 const AlternateProtocolInfo alternate = | 287 const AlternateProtocolInfo alternate = |
| 290 session_->http_server_properties()->GetAlternateProtocol( | 288 session_->http_server_properties()->GetAlternateProtocol( |
| 291 HostPortPair::FromURL(request_.url)); | 289 HostPortPair::FromURL(request_.url)); |
| 292 EXPECT_TRUE(alternate.is_broken); | 290 EXPECT_TRUE(alternate.is_broken); |
| 293 } | 291 } |
| 294 | 292 |
| 295 void ExpectQuicAlternateProtocolMapping() { | 293 void ExpectQuicAlternateProtocolMapping() { |
| 296 ASSERT_TRUE(session_->http_server_properties()->HasAlternateProtocol( | |
| 297 HostPortPair::FromURL(request_.url))); | |
| 298 const AlternateProtocolInfo alternate = | 294 const AlternateProtocolInfo alternate = |
| 299 session_->http_server_properties()->GetAlternateProtocol( | 295 session_->http_server_properties()->GetAlternateProtocol( |
| 300 HostPortPair::FromURL(request_.url)); | 296 HostPortPair::FromURL(request_.url)); |
| 301 EXPECT_EQ(QUIC, alternate.protocol); | 297 EXPECT_EQ(QUIC, alternate.protocol); |
| 302 } | 298 } |
| 303 | 299 |
| 304 void AddHangingNonAlternateProtocolSocketData() { | 300 void AddHangingNonAlternateProtocolSocketData() { |
| 305 MockConnect hanging_connect(SYNCHRONOUS, ERR_IO_PENDING); | 301 MockConnect hanging_connect(SYNCHRONOUS, ERR_IO_PENDING); |
| 306 hanging_data_.set_connect_data(hanging_connect); | 302 hanging_data_.set_connect_data(hanging_connect); |
| 307 socket_factory_.AddSocketDataProvider(&hanging_data_); | 303 socket_factory_.AddSocketDataProvider(&hanging_data_); |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 nullptr, | 1031 nullptr, |
| 1036 net_log_.bound()); | 1032 net_log_.bound()); |
| 1037 | 1033 |
| 1038 CreateSessionWithNextProtos(); | 1034 CreateSessionWithNextProtos(); |
| 1039 AddQuicAlternateProtocolMapping(MockCryptoClientStream::ZERO_RTT); | 1035 AddQuicAlternateProtocolMapping(MockCryptoClientStream::ZERO_RTT); |
| 1040 SendRequestAndExpectHttpResponse("hello world"); | 1036 SendRequestAndExpectHttpResponse("hello world"); |
| 1041 } | 1037 } |
| 1042 | 1038 |
| 1043 } // namespace test | 1039 } // namespace test |
| 1044 } // namespace net | 1040 } // namespace net |
| OLD | NEW |