Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: net/spdy/spdy_session_spdy2_unittest.cc

Issue 14471023: Refactor pooled socket request code to prepare for implementation of pretend-to-preconnect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: don't overload SSLSocketParams c-tor Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "net/base/io_buffer.h" 8 #include "net/base/io_buffer.h"
9 #include "net/base/ip_endpoint.h" 9 #include "net/base/ip_endpoint.h"
10 #include "net/base/net_log_unittest.h" 10 #include "net/base/net_log_unittest.h"
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 1230
1231 scoped_refptr<SpdySession> session = GetSession(pair_); 1231 scoped_refptr<SpdySession> session = GetSession(pair_);
1232 1232
1233 SSLConfig ssl_config; 1233 SSLConfig ssl_config;
1234 scoped_refptr<TransportSocketParams> transport_params( 1234 scoped_refptr<TransportSocketParams> transport_params(
1235 new TransportSocketParams(test_host_port_pair_, 1235 new TransportSocketParams(test_host_port_pair_,
1236 MEDIUM, 1236 MEDIUM,
1237 false, 1237 false,
1238 false, 1238 false,
1239 OnHostResolutionCallback())); 1239 OnHostResolutionCallback()));
1240 scoped_refptr<SOCKSSocketParams> socks_params; 1240 scoped_refptr<SSLSocketParams> ssl_params =
1241 scoped_refptr<HttpProxySocketParams> http_proxy_params; 1241 SSLSocketParams::CreateForDirectConnection(
1242 scoped_refptr<SSLSocketParams> ssl_params( 1242 transport_params,
1243 new SSLSocketParams(transport_params, 1243 test_host_port_pair_,
1244 socks_params, 1244 ssl_config,
1245 http_proxy_params, 1245 0,
1246 ProxyServer::SCHEME_DIRECT, 1246 false,
1247 test_host_port_pair_, 1247 false);
1248 ssl_config,
1249 0,
1250 false,
1251 false));
1252 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); 1248 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
1253 EXPECT_EQ(OK, connection->Init(test_host_port_pair_.ToString(), 1249 EXPECT_EQ(OK, connection->Init(test_host_port_pair_.ToString(),
1254 ssl_params, MEDIUM, CompletionCallback(), 1250 ssl_params, MEDIUM, CompletionCallback(),
1255 http_session_->GetSSLSocketPool( 1251 http_session_->GetSSLSocketPool(
1256 HttpNetworkSession::NORMAL_SOCKET_POOL), 1252 HttpNetworkSession::NORMAL_SOCKET_POOL),
1257 BoundNetLog())); 1253 BoundNetLog()));
1258 1254
1259 EXPECT_EQ(OK, session->InitializeWithSocket(connection.release(), false, OK)); 1255 EXPECT_EQ(OK, session->InitializeWithSocket(connection.release(), false, OK));
1260 EXPECT_TRUE(session->VerifyDomainAuthentication("www.example.org")); 1256 EXPECT_TRUE(session->VerifyDomainAuthentication("www.example.org"));
1261 EXPECT_TRUE(session->VerifyDomainAuthentication("mail.example.org")); 1257 EXPECT_TRUE(session->VerifyDomainAuthentication("mail.example.org"));
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 1295
1300 scoped_refptr<SpdySession> session = GetSession(pair_); 1296 scoped_refptr<SpdySession> session = GetSession(pair_);
1301 1297
1302 SSLConfig ssl_config; 1298 SSLConfig ssl_config;
1303 scoped_refptr<TransportSocketParams> transport_params( 1299 scoped_refptr<TransportSocketParams> transport_params(
1304 new TransportSocketParams(test_host_port_pair_, 1300 new TransportSocketParams(test_host_port_pair_,
1305 MEDIUM, 1301 MEDIUM,
1306 false, 1302 false,
1307 false, 1303 false,
1308 OnHostResolutionCallback())); 1304 OnHostResolutionCallback()));
1309 scoped_refptr<SOCKSSocketParams> socks_params; 1305 scoped_refptr<SSLSocketParams> ssl_params =
1310 scoped_refptr<HttpProxySocketParams> http_proxy_params; 1306 SSLSocketParams::CreateForDirectConnection(
1311 scoped_refptr<SSLSocketParams> ssl_params( 1307 transport_params,
1312 new SSLSocketParams(transport_params, 1308 test_host_port_pair_,
1313 socks_params, 1309 ssl_config,
1314 http_proxy_params, 1310 0,
1315 ProxyServer::SCHEME_DIRECT, 1311 false,
1316 test_host_port_pair_, 1312 false);
1317 ssl_config,
1318 0,
1319 false,
1320 false));
1321 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); 1313 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
1322 EXPECT_EQ(OK, connection->Init(test_host_port_pair_.ToString(), 1314 EXPECT_EQ(OK, connection->Init(test_host_port_pair_.ToString(),
1323 ssl_params, MEDIUM, CompletionCallback(), 1315 ssl_params, MEDIUM, CompletionCallback(),
1324 http_session_->GetSSLSocketPool( 1316 http_session_->GetSSLSocketPool(
1325 HttpNetworkSession::NORMAL_SOCKET_POOL), 1317 HttpNetworkSession::NORMAL_SOCKET_POOL),
1326 BoundNetLog())); 1318 BoundNetLog()));
1327 1319
1328 EXPECT_EQ(OK, session->InitializeWithSocket(connection.release(), false, OK)); 1320 EXPECT_EQ(OK, session->InitializeWithSocket(connection.release(), false, OK));
1329 EXPECT_TRUE(session->VerifyDomainAuthentication("www.example.org")); 1321 EXPECT_TRUE(session->VerifyDomainAuthentication("www.example.org"));
1330 EXPECT_TRUE(session->VerifyDomainAuthentication("mail.example.org")); 1322 EXPECT_TRUE(session->VerifyDomainAuthentication("mail.example.org"));
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1558 1550
1559 scoped_refptr<SpdySession> session = GetSession(pair); 1551 scoped_refptr<SpdySession> session = GetSession(pair);
1560 1552
1561 SSLConfig ssl_config; 1553 SSLConfig ssl_config;
1562 scoped_refptr<TransportSocketParams> transport_params( 1554 scoped_refptr<TransportSocketParams> transport_params(
1563 new TransportSocketParams(test_host_port_pair, 1555 new TransportSocketParams(test_host_port_pair,
1564 MEDIUM, 1556 MEDIUM,
1565 false, 1557 false,
1566 false, 1558 false,
1567 OnHostResolutionCallback())); 1559 OnHostResolutionCallback()));
1568 scoped_refptr<SOCKSSocketParams> socks_params; 1560 scoped_refptr<SSLSocketParams> ssl_params =
1569 scoped_refptr<HttpProxySocketParams> http_proxy_params; 1561 SSLSocketParams::CreateForDirectConnection(
1570 scoped_refptr<SSLSocketParams> ssl_params( 1562 transport_params,
1571 new SSLSocketParams(transport_params, 1563 test_host_port_pair,
1572 socks_params, 1564 ssl_config,
1573 http_proxy_params, 1565 0,
1574 ProxyServer::SCHEME_DIRECT, 1566 false,
1575 test_host_port_pair, 1567 false);
1576 ssl_config,
1577 0,
1578 false,
1579 false));
1580 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); 1568 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
1581 EXPECT_EQ(OK, connection->Init(test_host_port_pair.ToString(), 1569 EXPECT_EQ(OK, connection->Init(test_host_port_pair.ToString(),
1582 ssl_params, MEDIUM, CompletionCallback(), 1570 ssl_params, MEDIUM, CompletionCallback(),
1583 http_session_->GetSSLSocketPool( 1571 http_session_->GetSSLSocketPool(
1584 HttpNetworkSession::NORMAL_SOCKET_POOL), 1572 HttpNetworkSession::NORMAL_SOCKET_POOL),
1585 BoundNetLog())); 1573 BoundNetLog()));
1586 1574
1587 EXPECT_EQ(OK, session->InitializeWithSocket(connection.release(), true, OK)); 1575 EXPECT_EQ(OK, session->InitializeWithSocket(connection.release(), true, OK));
1588 1576
1589 EXPECT_FALSE(session->NeedsCredentials()); 1577 EXPECT_FALSE(session->NeedsCredentials());
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 http_session_.get(), session.get(), test_host_port_pair_); 1978 http_session_.get(), session.get(), test_host_port_pair_);
1991 1979
1992 EXPECT_EQ(SpdySession::FLOW_CONTROL_NONE, session->flow_control_state()); 1980 EXPECT_EQ(SpdySession::FLOW_CONTROL_NONE, session->flow_control_state());
1993 EXPECT_EQ(kSpdyVersion2, session->buffered_spdy_framer_->protocol_version()); 1981 EXPECT_EQ(kSpdyVersion2, session->buffered_spdy_framer_->protocol_version());
1994 EXPECT_EQ(0, session->session_send_window_size_); 1982 EXPECT_EQ(0, session->session_send_window_size_);
1995 EXPECT_EQ(0, session->session_recv_window_size_); 1983 EXPECT_EQ(0, session->session_recv_window_size_);
1996 EXPECT_EQ(0, session->session_unacked_recv_window_bytes_); 1984 EXPECT_EQ(0, session->session_unacked_recv_window_bytes_);
1997 } 1985 }
1998 1986
1999 } // namespace net 1987 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698