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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 session_->http_server_properties()->SetAlternateProtocol( | 279 session_->http_server_properties()->SetAlternateProtocol( |
280 HostPortPair::FromURL(request_.url), 80, QUIC, 1); | 280 HostPortPair::FromURL(request_.url), 80, QUIC, 1); |
281 } | 281 } |
282 | 282 |
283 void ExpectBrokenAlternateProtocolMapping() { | 283 void ExpectBrokenAlternateProtocolMapping() { |
284 ASSERT_TRUE(session_->http_server_properties()->HasAlternateProtocol( | 284 ASSERT_TRUE(session_->http_server_properties()->HasAlternateProtocol( |
285 HostPortPair::FromURL(request_.url))); | 285 HostPortPair::FromURL(request_.url))); |
286 const AlternateProtocolInfo alternate = | 286 const AlternateProtocolInfo alternate = |
287 session_->http_server_properties()->GetAlternateProtocol( | 287 session_->http_server_properties()->GetAlternateProtocol( |
288 HostPortPair::FromURL(request_.url)); | 288 HostPortPair::FromURL(request_.url)); |
289 EXPECT_EQ(ALTERNATE_PROTOCOL_BROKEN, alternate.protocol); | 289 EXPECT_TRUE(alternate.is_broken); |
290 } | 290 } |
291 | 291 |
292 void ExpectQuicAlternateProtocolMapping() { | 292 void ExpectQuicAlternateProtocolMapping() { |
293 ASSERT_TRUE(session_->http_server_properties()->HasAlternateProtocol( | 293 ASSERT_TRUE(session_->http_server_properties()->HasAlternateProtocol( |
294 HostPortPair::FromURL(request_.url))); | 294 HostPortPair::FromURL(request_.url))); |
295 const AlternateProtocolInfo alternate = | 295 const AlternateProtocolInfo alternate = |
296 session_->http_server_properties()->GetAlternateProtocol( | 296 session_->http_server_properties()->GetAlternateProtocol( |
297 HostPortPair::FromURL(request_.url)); | 297 HostPortPair::FromURL(request_.url)); |
298 EXPECT_EQ(QUIC, alternate.protocol); | 298 EXPECT_EQ(QUIC, alternate.protocol); |
299 } | 299 } |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 nullptr, | 1032 nullptr, |
1033 net_log_.bound()); | 1033 net_log_.bound()); |
1034 | 1034 |
1035 CreateSessionWithNextProtos(); | 1035 CreateSessionWithNextProtos(); |
1036 AddQuicAlternateProtocolMapping(MockCryptoClientStream::ZERO_RTT); | 1036 AddQuicAlternateProtocolMapping(MockCryptoClientStream::ZERO_RTT); |
1037 SendRequestAndExpectHttpResponse("hello world"); | 1037 SendRequestAndExpectHttpResponse("hello world"); |
1038 } | 1038 } |
1039 | 1039 |
1040 } // namespace test | 1040 } // namespace test |
1041 } // namespace net | 1041 } // namespace net |
OLD | NEW |