| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "net/http/bidirectional_stream.h" | 5 #include "net/http/bidirectional_stream.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1460 | 1460 |
| 1461 MockRead reads[] = { | 1461 MockRead reads[] = { |
| 1462 CreateMockRead(*resp, 1), CreateMockRead(*body_frame, 2), | 1462 CreateMockRead(*resp, 1), CreateMockRead(*body_frame, 2), |
| 1463 MockRead(SYNCHRONOUS, 0, 3), | 1463 MockRead(SYNCHRONOUS, 0, 3), |
| 1464 }; | 1464 }; |
| 1465 | 1465 |
| 1466 HostPortPair host_port_pair("www.example.org", 443); | 1466 HostPortPair host_port_pair("www.example.org", 443); |
| 1467 url::SchemeHostPort server("https", "www.example.org", 443); | 1467 url::SchemeHostPort server("https", "www.example.org", 443); |
| 1468 SpdySessionKey key(host_port_pair, ProxyServer::Direct(), | 1468 SpdySessionKey key(host_port_pair, ProxyServer::Direct(), |
| 1469 PRIVACY_MODE_DISABLED); | 1469 PRIVACY_MODE_DISABLED); |
| 1470 session_deps_.parse_alternative_services = true; | |
| 1471 // Enable QUIC so that the alternative service header can be added to | 1470 // Enable QUIC so that the alternative service header can be added to |
| 1472 // HttpServerProperties. | 1471 // HttpServerProperties. |
| 1473 session_deps_.enable_quic = true; | 1472 session_deps_.enable_quic = true; |
| 1474 InitSession(reads, arraysize(reads), writes, arraysize(writes), key); | 1473 InitSession(reads, arraysize(reads), writes, arraysize(writes), key); |
| 1475 | 1474 |
| 1476 std::unique_ptr<BidirectionalStreamRequestInfo> request_info( | 1475 std::unique_ptr<BidirectionalStreamRequestInfo> request_info( |
| 1477 new BidirectionalStreamRequestInfo); | 1476 new BidirectionalStreamRequestInfo); |
| 1478 request_info->method = "GET"; | 1477 request_info->method = "GET"; |
| 1479 request_info->url = GURL("https://www.example.org/"); | 1478 request_info->url = GURL("https://www.example.org/"); |
| 1480 request_info->priority = LOWEST; | 1479 request_info->priority = LOWEST; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1501 AlternativeServiceVector alternative_service_vector = | 1500 AlternativeServiceVector alternative_service_vector = |
| 1502 http_session_->http_server_properties()->GetAlternativeServices(server); | 1501 http_session_->http_server_properties()->GetAlternativeServices(server); |
| 1503 ASSERT_EQ(1u, alternative_service_vector.size()); | 1502 ASSERT_EQ(1u, alternative_service_vector.size()); |
| 1504 EXPECT_EQ(AlternateProtocolFromNextProto(kProtoQUIC1SPDY3), | 1503 EXPECT_EQ(AlternateProtocolFromNextProto(kProtoQUIC1SPDY3), |
| 1505 alternative_service_vector[0].protocol); | 1504 alternative_service_vector[0].protocol); |
| 1506 EXPECT_EQ("www.example.org", alternative_service_vector[0].host); | 1505 EXPECT_EQ("www.example.org", alternative_service_vector[0].host); |
| 1507 EXPECT_EQ(443, alternative_service_vector[0].port); | 1506 EXPECT_EQ(443, alternative_service_vector[0].port); |
| 1508 } | 1507 } |
| 1509 | 1508 |
| 1510 } // namespace net | 1509 } // namespace net |
| OLD | NEW |