diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-03 21:48:34 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-03 21:48:34 +0000 |
commit | 9e1bdd3f9785ed8a84a137c98b781ddaec41b080 (patch) | |
tree | 36d3550cc6d9db08bf3a18fbb42668d440a94b56 /net/http/http_response_body_drainer_unittest.cc | |
parent | 966c57777b2c18313cddd8e36d109665f5377521 (diff) | |
download | chromium_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 'net/http/http_response_body_drainer_unittest.cc')
-rw-r--r-- | net/http/http_response_body_drainer_unittest.cc | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/net/http/http_response_body_drainer_unittest.cc b/net/http/http_response_body_drainer_unittest.cc index 76304f8..5745865 100644 --- a/net/http/http_response_body_drainer_unittest.cc +++ b/net/http/http_response_body_drainer_unittest.cc @@ -16,7 +16,6 @@ #include "net/http/http_network_session.h" #include "net/http/http_stream.h" #include "net/proxy/proxy_service.h" -#include "net/spdy/spdy_session_pool.h" #include "testing/gtest/include/gtest/gtest.h" namespace net { @@ -174,23 +173,23 @@ void MockHttpStream::CompleteRead() { class HttpResponseBodyDrainerTest : public testing::Test { protected: HttpResponseBodyDrainerTest() - : session_(new HttpNetworkSession( - NULL /* host_resolver */, - NULL /* dnsrr_resolver */, - NULL /* dns_cert_checker */, - NULL, - NULL /* ssl_host_info_factory */, - ProxyService::CreateDirect(), - NULL, - new SSLConfigServiceDefaults, - new SpdySessionPool(NULL), - NULL, - NULL, - NULL)), + : proxy_service_(ProxyService::CreateDirect()), + ssl_config_service_(new SSLConfigServiceDefaults), + session_(CreateNetworkSession()), mock_stream_(new MockHttpStream(&result_waiter_)), drainer_(new HttpResponseBodyDrainer(mock_stream_)) {} + ~HttpResponseBodyDrainerTest() {} + HttpNetworkSession* CreateNetworkSession() const { + HttpNetworkSession::Params params; + params.proxy_service = proxy_service_; + params.ssl_config_service = ssl_config_service_; + return new HttpNetworkSession(params); + } + + scoped_refptr<ProxyService> proxy_service_; + scoped_refptr<SSLConfigService> ssl_config_service_; const scoped_refptr<HttpNetworkSession> session_; CloseResultWaiter result_waiter_; MockHttpStream* const mock_stream_; // Owned by |drainer_|. |