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 9568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9579 } | 9579 } |
9580 | 9580 |
9581 TEST_P(HttpNetworkTransactionTest, HonorMultipleAlternativeServiceHeader) { | 9581 TEST_P(HttpNetworkTransactionTest, HonorMultipleAlternativeServiceHeader) { |
9582 session_deps_.next_protos = SpdyNextProtos(); | 9582 session_deps_.next_protos = SpdyNextProtos(); |
9583 session_deps_.use_alternative_services = true; | 9583 session_deps_.use_alternative_services = true; |
9584 | 9584 |
9585 MockRead data_reads[] = { | 9585 MockRead data_reads[] = { |
9586 MockRead("HTTP/1.1 200 OK\r\n"), | 9586 MockRead("HTTP/1.1 200 OK\r\n"), |
9587 MockRead("Alt-Svc: "), | 9587 MockRead("Alt-Svc: "), |
9588 MockRead(GetAlternateProtocolFromParam()), | 9588 MockRead(GetAlternateProtocolFromParam()), |
9589 MockRead("=\"www.example.com:443\";p=1.0,"), | 9589 MockRead("=\"www.example.com:443\";p=\"1.0\","), |
9590 MockRead("quic=\":1234\"\r\n\r\n"), | 9590 MockRead("quic=\":1234\"\r\n\r\n"), |
9591 MockRead("hello world"), | 9591 MockRead("hello world"), |
9592 MockRead(SYNCHRONOUS, OK), | 9592 MockRead(SYNCHRONOUS, OK), |
9593 }; | 9593 }; |
9594 | 9594 |
9595 HttpRequestInfo request; | 9595 HttpRequestInfo request; |
9596 request.method = "GET"; | 9596 request.method = "GET"; |
9597 request.url = GURL("http://www.example.org/"); | 9597 request.url = GURL("http://www.example.org/"); |
9598 request.load_flags = 0; | 9598 request.load_flags = 0; |
9599 | 9599 |
(...skipping 5766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15366 std::string response_data; | 15366 std::string response_data; |
15367 EXPECT_EQ(OK, ReadTransaction(trans.get(), &response_data)); | 15367 EXPECT_EQ(OK, ReadTransaction(trans.get(), &response_data)); |
15368 | 15368 |
15369 EXPECT_EQ(CountWriteBytes(data_writes, arraysize(data_writes)), | 15369 EXPECT_EQ(CountWriteBytes(data_writes, arraysize(data_writes)), |
15370 trans->GetTotalSentBytes()); | 15370 trans->GetTotalSentBytes()); |
15371 EXPECT_EQ(CountReadBytes(data_reads, arraysize(data_reads)), | 15371 EXPECT_EQ(CountReadBytes(data_reads, arraysize(data_reads)), |
15372 trans->GetTotalReceivedBytes()); | 15372 trans->GetTotalReceivedBytes()); |
15373 } | 15373 } |
15374 | 15374 |
15375 } // namespace net | 15375 } // namespace net |
OLD | NEW |