| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include <math.h> // ceil | 7 #include <math.h> // ceil |
| 8 #include <stdarg.h> | 8 #include <stdarg.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 8970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8981 } | 8981 } |
| 8982 | 8982 |
| 8983 TEST_P(HttpNetworkTransactionTest, HonorMultipleAlternativeServiceHeader) { | 8983 TEST_P(HttpNetworkTransactionTest, HonorMultipleAlternativeServiceHeader) { |
| 8984 session_deps_.next_protos = SpdyNextProtos(); | 8984 session_deps_.next_protos = SpdyNextProtos(); |
| 8985 session_deps_.use_alternative_services = true; | 8985 session_deps_.use_alternative_services = true; |
| 8986 | 8986 |
| 8987 MockRead data_reads[] = { | 8987 MockRead data_reads[] = { |
| 8988 MockRead("HTTP/1.1 200 OK\r\n"), | 8988 MockRead("HTTP/1.1 200 OK\r\n"), |
| 8989 MockRead("Alt-Svc: "), | 8989 MockRead("Alt-Svc: "), |
| 8990 MockRead(GetAlternateProtocolFromParam()), | 8990 MockRead(GetAlternateProtocolFromParam()), |
| 8991 MockRead("=\"www.example.com:443\";p=1.0,"), | 8991 MockRead("=\"www.example.com:443\";p=\"1.0\","), |
| 8992 MockRead("quic=\":1234\"\r\n\r\n"), | 8992 MockRead("quic=\":1234\"\r\n\r\n"), |
| 8993 MockRead("hello world"), | 8993 MockRead("hello world"), |
| 8994 MockRead(SYNCHRONOUS, OK), | 8994 MockRead(SYNCHRONOUS, OK), |
| 8995 }; | 8995 }; |
| 8996 | 8996 |
| 8997 HttpRequestInfo request; | 8997 HttpRequestInfo request; |
| 8998 request.method = "GET"; | 8998 request.method = "GET"; |
| 8999 request.url = GURL("http://www.example.org/"); | 8999 request.url = GURL("http://www.example.org/"); |
| 9000 request.load_flags = 0; | 9000 request.load_flags = 0; |
| 9001 | 9001 |
| (...skipping 5769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14771 std::string response_data; | 14771 std::string response_data; |
| 14772 EXPECT_EQ(OK, ReadTransaction(trans.get(), &response_data)); | 14772 EXPECT_EQ(OK, ReadTransaction(trans.get(), &response_data)); |
| 14773 | 14773 |
| 14774 EXPECT_EQ(CountWriteBytes(data_writes, arraysize(data_writes)), | 14774 EXPECT_EQ(CountWriteBytes(data_writes, arraysize(data_writes)), |
| 14775 trans->GetTotalSentBytes()); | 14775 trans->GetTotalSentBytes()); |
| 14776 EXPECT_EQ(CountReadBytes(data_reads, arraysize(data_reads)), | 14776 EXPECT_EQ(CountReadBytes(data_reads, arraysize(data_reads)), |
| 14777 trans->GetTotalReceivedBytes()); | 14777 trans->GetTotalReceivedBytes()); |
| 14778 } | 14778 } |
| 14779 | 14779 |
| 14780 } // namespace net | 14780 } // namespace net |
| OLD | NEW |