| 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 "net/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
| 6 | 6 |
| 7 #include "net/base/host_cache.h" | 7 #include "net/base/host_cache.h" |
| 8 #include "net/base/ip_endpoint.h" | 8 #include "net/base/ip_endpoint.h" |
| 9 #include "net/base/net_log_unittest.h" | 9 #include "net/base/net_log_unittest.h" |
| 10 #include "net/spdy/spdy_io_buffer.h" | 10 #include "net/spdy/spdy_io_buffer.h" |
| (...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 | 935 |
| 936 MockConnect connect_data(SYNCHRONOUS, OK); | 936 MockConnect connect_data(SYNCHRONOUS, OK); |
| 937 MockRead reads[] = { | 937 MockRead reads[] = { |
| 938 MockRead(SYNCHRONOUS, ERR_IO_PENDING) // Stall forever. | 938 MockRead(SYNCHRONOUS, ERR_IO_PENDING) // Stall forever. |
| 939 }; | 939 }; |
| 940 StaticSocketDataProvider data(reads, arraysize(reads), NULL, 0); | 940 StaticSocketDataProvider data(reads, arraysize(reads), NULL, 0); |
| 941 data.set_connect_data(connect_data); | 941 data.set_connect_data(connect_data); |
| 942 session_deps.socket_factory->AddSocketDataProvider(&data); | 942 session_deps.socket_factory->AddSocketDataProvider(&data); |
| 943 | 943 |
| 944 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); | 944 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); |
| 945 ssl.origin_bound_cert_type = CLIENT_CERT_ECDSA_SIGN; | 945 ssl.domain_bound_cert_type = CLIENT_CERT_ECDSA_SIGN; |
| 946 ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY3; | 946 ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY3; |
| 947 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl); | 947 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl); |
| 948 | 948 |
| 949 scoped_refptr<HttpNetworkSession> http_session( | 949 scoped_refptr<HttpNetworkSession> http_session( |
| 950 SpdySessionDependencies::SpdyCreateSession(&session_deps)); | 950 SpdySessionDependencies::SpdyCreateSession(&session_deps)); |
| 951 | 951 |
| 952 const std::string kTestHost("www.foo.com"); | 952 const std::string kTestHost("www.foo.com"); |
| 953 const int kTestPort = 80; | 953 const int kTestPort = 80; |
| 954 HostPortPair test_host_port_pair(kTestHost, kTestPort); | 954 HostPortPair test_host_port_pair(kTestHost, kTestPort); |
| 955 HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct()); | 955 HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct()); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1010 ConstructSpdySettings(settings)); | 1010 ConstructSpdySettings(settings)); |
| 1011 MockWrite writes[] = { | 1011 MockWrite writes[] = { |
| 1012 CreateMockWrite(*settings_frame), | 1012 CreateMockWrite(*settings_frame), |
| 1013 }; | 1013 }; |
| 1014 StaticSocketDataProvider data(reads, arraysize(reads), | 1014 StaticSocketDataProvider data(reads, arraysize(reads), |
| 1015 writes, arraysize(writes)); | 1015 writes, arraysize(writes)); |
| 1016 data.set_connect_data(connect_data); | 1016 data.set_connect_data(connect_data); |
| 1017 session_deps.socket_factory->AddSocketDataProvider(&data); | 1017 session_deps.socket_factory->AddSocketDataProvider(&data); |
| 1018 | 1018 |
| 1019 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); | 1019 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); |
| 1020 ssl.origin_bound_cert_type = CLIENT_CERT_ECDSA_SIGN; | 1020 ssl.domain_bound_cert_type = CLIENT_CERT_ECDSA_SIGN; |
| 1021 ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY3; | 1021 ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY3; |
| 1022 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl); | 1022 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl); |
| 1023 | 1023 |
| 1024 scoped_refptr<HttpNetworkSession> http_session( | 1024 scoped_refptr<HttpNetworkSession> http_session( |
| 1025 SpdySessionDependencies::SpdyCreateSession(&session_deps)); | 1025 SpdySessionDependencies::SpdyCreateSession(&session_deps)); |
| 1026 | 1026 |
| 1027 const std::string kTestHost("www.foo.com"); | 1027 const std::string kTestHost("www.foo.com"); |
| 1028 const int kTestPort = 80; | 1028 const int kTestPort = 80; |
| 1029 HostPortPair test_host_port_pair(kTestHost, kTestPort); | 1029 HostPortPair test_host_port_pair(kTestHost, kTestPort); |
| 1030 HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct()); | 1030 HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct()); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 net::NetLog::PHASE_NONE); | 1136 net::NetLog::PHASE_NONE); |
| 1137 | 1137 |
| 1138 CapturingNetLog::Entry entry = entries[pos]; | 1138 CapturingNetLog::Entry entry = entries[pos]; |
| 1139 NetLogSpdySessionCloseParameter* request_params = | 1139 NetLogSpdySessionCloseParameter* request_params = |
| 1140 static_cast<NetLogSpdySessionCloseParameter*>( | 1140 static_cast<NetLogSpdySessionCloseParameter*>( |
| 1141 entry.extra_parameters.get()); | 1141 entry.extra_parameters.get()); |
| 1142 EXPECT_EQ(ERR_CONNECTION_CLOSED, request_params->status()); | 1142 EXPECT_EQ(ERR_CONNECTION_CLOSED, request_params->status()); |
| 1143 } | 1143 } |
| 1144 | 1144 |
| 1145 } // namespace net | 1145 } // namespace net |
| OLD | NEW |