| 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 scoped_ptr<HttpNetworkTransaction> trans( | 272 scoped_ptr<HttpNetworkTransaction> trans( |
| 273 new HttpNetworkTransaction(DEFAULT_PRIORITY, session_.get())); | 273 new HttpNetworkTransaction(DEFAULT_PRIORITY, session_.get())); |
| 274 RunTransaction(trans.get()); | 274 RunTransaction(trans.get()); |
| 275 CheckWasQuicResponse(trans); | 275 CheckWasQuicResponse(trans); |
| 276 CheckResponseData(trans.get(), expected); | 276 CheckResponseData(trans.get(), expected); |
| 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()->AddAlternateProtocol( |
| 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( | 287 ASSERT_FALSE(session_->http_server_properties()->HasAlternateProtocol( |
| 288 HostPortPair::FromURL(request_.url))); | 288 HostPortPair::FromURL(request_.url))); |
| 289 const AlternateProtocolInfo alternate = | |
| 290 session_->http_server_properties()->GetAlternateProtocol( | |
| 291 HostPortPair::FromURL(request_.url)); | |
| 292 EXPECT_TRUE(alternate.is_broken); | |
| 293 } | 289 } |
| 294 | 290 |
| 295 void ExpectQuicAlternateProtocolMapping() { | 291 void ExpectQuicAlternateProtocolMapping() { |
| 296 ASSERT_TRUE(session_->http_server_properties()->HasAlternateProtocol( | 292 ASSERT_TRUE(session_->http_server_properties()->HasAlternateProtocol( |
| 297 HostPortPair::FromURL(request_.url))); | 293 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 } |
| (...skipping 732 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 |