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 5863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5874 "GET / HTTP/1.1\r\n" | 5874 "GET / HTTP/1.1\r\n" |
5875 "Host: www.example.org\r\n" | 5875 "Host: www.example.org\r\n" |
5876 "Connection: keep-alive\r\n\r\n"), | 5876 "Connection: keep-alive\r\n\r\n"), |
5877 MockWrite( | 5877 MockWrite( |
5878 "GET / HTTP/1.1\r\n" | 5878 "GET / HTTP/1.1\r\n" |
5879 "Host: www.example.org\r\n" | 5879 "Host: www.example.org\r\n" |
5880 "Connection: keep-alive\r\n\r\n"), | 5880 "Connection: keep-alive\r\n\r\n"), |
5881 }; | 5881 }; |
5882 | 5882 |
5883 MockRead data_reads[] = { | 5883 MockRead data_reads[] = { |
5884 MockRead("HTTP/1.1 200 OK\r\n"), | 5884 MockRead("HTTP/1.1 200 OK\r\n"), MockRead("Content-Length: 11\r\n\r\n"), |
5885 MockRead("Content-Length: 11\r\n\r\n"), | 5885 MockRead("hello world"), MockRead(ASYNC, ERR_CONNECTION_CLOSED)}; |
5886 MockRead(SYNCHRONOUS, ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ), | |
5887 MockRead("hello world"), | |
5888 MockRead(ASYNC, 0, 0) // EOF | |
5889 }; | |
5890 | 5886 |
5891 SSLSocketDataProvider ssl(ASYNC, OK); | 5887 SSLSocketDataProvider ssl(ASYNC, OK); |
5892 SSLSocketDataProvider ssl2(ASYNC, OK); | 5888 SSLSocketDataProvider ssl2(ASYNC, OK); |
5893 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); | 5889 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); |
5894 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl2); | 5890 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl2); |
5895 | 5891 |
5896 StaticSocketDataProvider data(data_reads, arraysize(data_reads), | 5892 StaticSocketDataProvider data(data_reads, arraysize(data_reads), |
5897 data_writes, arraysize(data_writes)); | 5893 data_writes, arraysize(data_writes)); |
5898 StaticSocketDataProvider data2(data_reads, arraysize(data_reads), | 5894 StaticSocketDataProvider data2(data_reads, arraysize(data_reads), |
5899 data_writes, arraysize(data_writes)); | 5895 data_writes, arraysize(data_writes)); |
(...skipping 9597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15497 | 15493 |
15498 scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); | 15494 scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
15499 HttpNetworkTransaction trans(DEFAULT_PRIORITY, session.get()); | 15495 HttpNetworkTransaction trans(DEFAULT_PRIORITY, session.get()); |
15500 | 15496 |
15501 EXPECT_THAT(trans.server_ssl_config_.alpn_protos, | 15497 EXPECT_THAT(trans.server_ssl_config_.alpn_protos, |
15502 testing::ElementsAre(kProtoHTTP2, kProtoSPDY31, kProtoHTTP11)); | 15498 testing::ElementsAre(kProtoHTTP2, kProtoSPDY31, kProtoHTTP11)); |
15503 EXPECT_TRUE(trans.server_ssl_config_.npn_protos.empty()); | 15499 EXPECT_TRUE(trans.server_ssl_config_.npn_protos.empty()); |
15504 } | 15500 } |
15505 | 15501 |
15506 } // namespace net | 15502 } // namespace net |
OLD | NEW |