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