summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/connection_tester_unittest.cc
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-03 21:48:34 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-03 21:48:34 +0000
commit9e1bdd3f9785ed8a84a137c98b781ddaec41b080 (patch)
tree36d3550cc6d9db08bf3a18fbb42668d440a94b56 /chrome/browser/net/connection_tester_unittest.cc
parent966c57777b2c18313cddd8e36d109665f5377521 (diff)
downloadchromium_src-9e1bdd3f9785ed8a84a137c98b781ddaec41b080.zip
chromium_src-9e1bdd3f9785ed8a84a137c98b781ddaec41b080.tar.gz
chromium_src-9e1bdd3f9785ed8a84a137c98b781ddaec41b080.tar.bz2
Refactor HttpNetworkSession construction.
Introduce HttpNetworkSession::Params. This should make it easy to add new optionally NULL parameters. I also took this opportunity to eliminate some copy/pastes of TestURLRequestContext and make them use the original. I was also able to remove the need for ClientSocketFactory::GetDefaultFactory() calls and new SpdySessionPool() calls in most places. BUG=none TEST=none Review URL: http://codereview.chromium.org/6349028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73669 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/connection_tester_unittest.cc')
-rw-r--r--chrome/browser/net/connection_tester_unittest.cc25
1 files changed, 8 insertions, 17 deletions
diff --git a/chrome/browser/net/connection_tester_unittest.cc b/chrome/browser/net/connection_tester_unittest.cc
index f08daf4..0bb5f50 100644
--- a/chrome/browser/net/connection_tester_unittest.cc
+++ b/chrome/browser/net/connection_tester_unittest.cc
@@ -16,8 +16,6 @@
#include "net/http/http_network_layer.h"
#include "net/http/http_network_session.h"
#include "net/proxy/proxy_config_service_fixed.h"
-#include "net/socket/client_socket_factory.h"
-#include "net/spdy/spdy_session_pool.h"
#include "net/test/test_server.h"
#include "net/url_request/url_request_context.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -88,7 +86,6 @@ class ConnectionTesterTest : public PlatformTest {
ConnectionTesterTest()
: test_server_(net::TestServer::TYPE_HTTP,
FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))),
- client_socket_factory_(net::ClientSocketFactory::GetDefaultFactory()),
proxy_script_fetcher_context_(new net::URLRequestContext),
message_loop_(MessageLoop::TYPE_IO),
io_thread_(BrowserThread::IO, &message_loop_) {
@@ -98,7 +95,6 @@ class ConnectionTesterTest : public PlatformTest {
protected:
net::TestServer test_server_;
ConnectionTesterDelegate test_delegate_;
- net::ClientSocketFactory* const client_socket_factory_;
net::MockHostResolver host_resolver_;
net::CertVerifier cert_verifier_;
net::DnsRRResolver dnsrr_resolver_;
@@ -118,20 +114,15 @@ class ConnectionTesterTest : public PlatformTest {
proxy_service_ = net::ProxyService::CreateDirect();
proxy_script_fetcher_context_->set_proxy_service(proxy_service_);
ssl_config_service_ = net::SSLConfigService::CreateSystemSSLConfigService();
+ net::HttpNetworkSession::Params session_params;
+ session_params.host_resolver = &host_resolver_;
+ session_params.cert_verifier = &cert_verifier_;
+ session_params.dnsrr_resolver = &dnsrr_resolver_;
+ session_params.http_auth_handler_factory = &http_auth_handler_factory_;
+ session_params.ssl_config_service = ssl_config_service_;
+ session_params.proxy_service = proxy_service_;
scoped_refptr<net::HttpNetworkSession> network_session(
- new net::HttpNetworkSession(
- &host_resolver_,
- &cert_verifier_,
- &dnsrr_resolver_,
- NULL /* dns_cert_checker */,
- NULL /* ssl_host_info_factory */,
- proxy_service_.get(),
- client_socket_factory_,
- ssl_config_service_,
- new net::SpdySessionPool(ssl_config_service_),
- &http_auth_handler_factory_,
- NULL /* network_delegate */,
- NULL /* net_log */));
+ new net::HttpNetworkSession(session_params));
http_transaction_factory_.reset(
new net::HttpNetworkLayer(network_session));
proxy_script_fetcher_context_->set_http_transaction_factory(