| OLD | NEW | 
|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_proxy_client_socket_pool.h" | 5 #include "net/http/http_proxy_client_socket_pool.h" | 
| 6 | 6 | 
| 7 #include "base/callback.h" | 7 #include "base/callback.h" | 
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" | 
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" | 
| 10 #include "base/time.h" | 10 #include "base/time.h" | 
| (...skipping 22 matching lines...) Expand all  Loading... | 
| 33 const int kMaxSocketsPerGroup = 6; | 33 const int kMaxSocketsPerGroup = 6; | 
| 34 | 34 | 
| 35 class SSLClientSocketPoolTest : public testing::Test { | 35 class SSLClientSocketPoolTest : public testing::Test { | 
| 36  protected: | 36  protected: | 
| 37   SSLClientSocketPoolTest() | 37   SSLClientSocketPoolTest() | 
| 38       : host_resolver_(new MockHostResolver), | 38       : host_resolver_(new MockHostResolver), | 
| 39         http_auth_handler_factory_(HttpAuthHandlerFactory::CreateDefault( | 39         http_auth_handler_factory_(HttpAuthHandlerFactory::CreateDefault( | 
| 40             host_resolver_.get())), | 40             host_resolver_.get())), | 
| 41         session_(new HttpNetworkSession(host_resolver_.get(), | 41         session_(new HttpNetworkSession(host_resolver_.get(), | 
| 42                                         NULL /* dnsrr_resolver */, | 42                                         NULL /* dnsrr_resolver */, | 
|  | 43                                         NULL /* ssl_host_info_factory */, | 
| 43                                         ProxyService::CreateDirect(), | 44                                         ProxyService::CreateDirect(), | 
| 44                                         &socket_factory_, | 45                                         &socket_factory_, | 
| 45                                         new SSLConfigServiceDefaults, | 46                                         new SSLConfigServiceDefaults, | 
| 46                                         new SpdySessionPool(NULL), | 47                                         new SpdySessionPool(NULL), | 
| 47                                         http_auth_handler_factory_.get(), | 48                                         http_auth_handler_factory_.get(), | 
| 48                                         NULL, | 49                                         NULL, | 
| 49                                         NULL)), | 50                                         NULL)), | 
| 50         direct_tcp_socket_params_(new TCPSocketParams( | 51         direct_tcp_socket_params_(new TCPSocketParams( | 
| 51             HostPortPair("host", 443), MEDIUM, GURL(), false)), | 52             HostPortPair("host", 443), MEDIUM, GURL(), false)), | 
| 52         tcp_histograms_("MockTCP"), | 53         tcp_histograms_("MockTCP"), | 
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 89   } | 90   } | 
| 90 | 91 | 
| 91   void CreatePool(bool tcp_pool, bool http_proxy_pool, bool socks_pool) { | 92   void CreatePool(bool tcp_pool, bool http_proxy_pool, bool socks_pool) { | 
| 92     ssl_histograms_.reset(new ClientSocketPoolHistograms("SSLUnitTest")); | 93     ssl_histograms_.reset(new ClientSocketPoolHistograms("SSLUnitTest")); | 
| 93     pool_.reset(new SSLClientSocketPool( | 94     pool_.reset(new SSLClientSocketPool( | 
| 94         kMaxSockets, | 95         kMaxSockets, | 
| 95         kMaxSocketsPerGroup, | 96         kMaxSocketsPerGroup, | 
| 96         ssl_histograms_.get(), | 97         ssl_histograms_.get(), | 
| 97         NULL, | 98         NULL, | 
| 98         NULL /* dnsrr_resolver */, | 99         NULL /* dnsrr_resolver */, | 
|  | 100         NULL /* ssl_host_info_factory */, | 
| 99         &socket_factory_, | 101         &socket_factory_, | 
| 100         tcp_pool ? &tcp_socket_pool_ : NULL, | 102         tcp_pool ? &tcp_socket_pool_ : NULL, | 
| 101         socks_pool ? &socks_socket_pool_ : NULL, | 103         socks_pool ? &socks_socket_pool_ : NULL, | 
| 102         http_proxy_pool ? &http_proxy_socket_pool_ : NULL, | 104         http_proxy_pool ? &http_proxy_socket_pool_ : NULL, | 
| 103         NULL, | 105         NULL, | 
| 104         NULL)); | 106         NULL)); | 
| 105   } | 107   } | 
| 106 | 108 | 
| 107   scoped_refptr<SSLSocketParams> SSLParams(ProxyServer::Scheme proxy, | 109   scoped_refptr<SSLSocketParams> SSLParams(ProxyServer::Scheme proxy, | 
| 108                                            bool want_spdy_over_npn) { | 110                                            bool want_spdy_over_npn) { | 
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 629       handle.release_pending_http_proxy_connection()); | 631       handle.release_pending_http_proxy_connection()); | 
| 630   EXPECT_TRUE(tunnel_handle->socket()); | 632   EXPECT_TRUE(tunnel_handle->socket()); | 
| 631   EXPECT_FALSE(tunnel_handle->socket()->IsConnected()); | 633   EXPECT_FALSE(tunnel_handle->socket()->IsConnected()); | 
| 632 } | 634 } | 
| 633 | 635 | 
| 634 // It would be nice to also test the timeouts in SSLClientSocketPool. | 636 // It would be nice to also test the timeouts in SSLClientSocketPool. | 
| 635 | 637 | 
| 636 }  // namespace | 638 }  // namespace | 
| 637 | 639 | 
| 638 }  // namespace net | 640 }  // namespace net | 
| OLD | NEW | 
|---|