Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_stream_factory_impl.h" | 5 #include "net/http/http_stream_factory_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "net/base/cert_verifier.h" | 10 #include "net/base/cert_verifier.h" |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 337 peer.SetSocketPoolForSSLWithProxy(proxy_host, ssl_conn_pool); | 337 peer.SetSocketPoolForSSLWithProxy(proxy_host, ssl_conn_pool); |
| 338 PreconnectHelper(kTests[i], session); | 338 PreconnectHelper(kTests[i], session); |
| 339 if (kTests[i].ssl) | 339 if (kTests[i].ssl) |
| 340 EXPECT_EQ(kTests[i].num_streams, ssl_conn_pool->last_num_streams()); | 340 EXPECT_EQ(kTests[i].num_streams, ssl_conn_pool->last_num_streams()); |
| 341 else | 341 else |
| 342 EXPECT_EQ(kTests[i].num_streams, socks_proxy_pool->last_num_streams()); | 342 EXPECT_EQ(kTests[i].num_streams, socks_proxy_pool->last_num_streams()); |
| 343 } | 343 } |
| 344 } | 344 } |
| 345 | 345 |
| 346 TEST(HttpStreamFactoryTest, PreconnectDirectWithExistingSpdySession) { | 346 TEST(HttpStreamFactoryTest, PreconnectDirectWithExistingSpdySession) { |
| 347 // Disable sending PING. | |
| 348 SpdySession::set_enable_ping_based_connection_checking(false); | |
|
willchan no longer on Chromium
2011/10/15 08:08:03
It looks weird that we are only disabling PING for
ramant (doing other things)
2011/10/15 23:33:11
Done.
| |
| 347 for (size_t i = 0; i < arraysize(kTests); ++i) { | 349 for (size_t i = 0; i < arraysize(kTests); ++i) { |
| 348 SessionDependencies session_deps(ProxyService::CreateDirect()); | 350 SessionDependencies session_deps(ProxyService::CreateDirect()); |
| 349 scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); | 351 scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); |
| 350 HttpNetworkSessionPeer peer(session); | 352 HttpNetworkSessionPeer peer(session); |
| 351 | 353 |
| 352 // Set an existing SpdySession in the pool. | 354 // Set an existing SpdySession in the pool. |
| 353 HostPortPair host_port_pair("www.google.com", 443); | 355 HostPortPair host_port_pair("www.google.com", 443); |
| 354 HostPortProxyPair pair(host_port_pair, ProxyServer::Direct()); | 356 HostPortProxyPair pair(host_port_pair, ProxyServer::Direct()); |
| 355 scoped_refptr<SpdySession> spdy_session = | 357 scoped_refptr<SpdySession> spdy_session = |
| 356 session->spdy_session_pool()->Get(pair, BoundNetLog()); | 358 session->spdy_session_pool()->Get(pair, BoundNetLog()); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 414 const ProxyRetryInfoMap& retry_info = | 416 const ProxyRetryInfoMap& retry_info = |
| 415 session->proxy_service()->proxy_retry_info(); | 417 session->proxy_service()->proxy_retry_info(); |
| 416 EXPECT_EQ(1u, retry_info.size()); | 418 EXPECT_EQ(1u, retry_info.size()); |
| 417 ProxyRetryInfoMap::const_iterator iter = retry_info.find("bad:99"); | 419 ProxyRetryInfoMap::const_iterator iter = retry_info.find("bad:99"); |
| 418 EXPECT_TRUE(iter != retry_info.end()); | 420 EXPECT_TRUE(iter != retry_info.end()); |
| 419 } | 421 } |
| 420 | 422 |
| 421 } // namespace | 423 } // namespace |
| 422 | 424 |
| 423 } // namespace net | 425 } // namespace net |
| OLD | NEW |