| Index: net/spdy/spdy_stream_unittest.cc
|
| diff --git a/net/spdy/spdy_stream_unittest.cc b/net/spdy/spdy_stream_unittest.cc
|
| index 34ae922ade2dae701c02c4b56e3b18a7c361df9f..843bd88531b9d9e83533e0e38f7c3f7905bd0c1c 100644
|
| --- a/net/spdy/spdy_stream_unittest.cc
|
| +++ b/net/spdy/spdy_stream_unittest.cc
|
| @@ -4,22 +4,7 @@
|
|
|
| #include "net/spdy/spdy_stream.h"
|
| #include "base/ref_counted.h"
|
| -#include "base/time.h"
|
| -#include "net/base/mock_host_resolver.h"
|
| -#include "net/base/net_errors.h"
|
| -#include "net/base/net_log.h"
|
| -#include "net/base/ssl_config_service.h"
|
| -#include "net/base/ssl_config_service_defaults.h"
|
| -#include "net/base/test_completion_callback.h"
|
| -#include "net/http/http_auth_handler_factory.h"
|
| -#include "net/http/http_network_session.h"
|
| -#include "net/http/http_request_info.h"
|
| -#include "net/http/http_response_info.h"
|
| -#include "net/proxy/proxy_service.h"
|
| -#include "net/socket/socket_test_util.h"
|
| -#include "net/spdy/spdy_framer.h"
|
| #include "net/spdy/spdy_session.h"
|
| -#include "net/spdy/spdy_session_pool.h"
|
| #include "net/spdy/spdy_test_util.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| @@ -48,45 +33,6 @@ ProxyService* CreateNullProxyService() {
|
| return ProxyService::CreateNull();
|
| }
|
|
|
| -// Helper to manage the lifetimes of the dependencies for a
|
| -// SpdyNetworkTransaction.
|
| -class SessionDependencies {
|
| - public:
|
| - // Default set of dependencies -- "null" proxy service.
|
| - SessionDependencies()
|
| - : host_resolver(new MockHostResolver),
|
| - proxy_service(CreateNullProxyService()),
|
| - ssl_config_service(new SSLConfigServiceDefaults),
|
| - http_auth_handler_factory(HttpAuthHandlerFactory::CreateDefault()),
|
| - spdy_session_pool(new SpdySessionPool()) {}
|
| -
|
| - // Custom proxy service dependency.
|
| - explicit SessionDependencies(ProxyService* proxy_service)
|
| - : host_resolver(new MockHostResolver),
|
| - proxy_service(proxy_service),
|
| - ssl_config_service(new SSLConfigServiceDefaults),
|
| - http_auth_handler_factory(HttpAuthHandlerFactory::CreateDefault()),
|
| - spdy_session_pool(new SpdySessionPool()) {}
|
| -
|
| - scoped_refptr<MockHostResolverBase> host_resolver;
|
| - scoped_refptr<ProxyService> proxy_service;
|
| - scoped_refptr<SSLConfigService> ssl_config_service;
|
| - MockClientSocketFactory socket_factory;
|
| - scoped_ptr<HttpAuthHandlerFactory> http_auth_handler_factory;
|
| - scoped_refptr<SpdySessionPool> spdy_session_pool;
|
| -};
|
| -
|
| -HttpNetworkSession* CreateSession(SessionDependencies* session_deps) {
|
| - return new HttpNetworkSession(session_deps->host_resolver,
|
| - session_deps->proxy_service,
|
| - &session_deps->socket_factory,
|
| - session_deps->ssl_config_service,
|
| - session_deps->spdy_session_pool,
|
| - session_deps->http_auth_handler_factory.get(),
|
| - NULL,
|
| - NULL);
|
| -}
|
| -
|
| class TestSpdyStreamDelegate : public SpdyStream::Delegate {
|
| public:
|
| TestSpdyStreamDelegate(SpdyStream* stream,
|
| @@ -186,9 +132,9 @@ class SpdyStreamTest : public testing::Test {
|
| };
|
|
|
| TEST_F(SpdyStreamTest, SendDataAfterOpen) {
|
| - SessionDependencies session_deps;
|
| + SpdySessionDependencies session_deps;
|
|
|
| - session_ = CreateSession(&session_deps);
|
| + session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps);
|
| SpdySessionPoolPeer pool_peer_(session_->spdy_session_pool());
|
|
|
| const SpdyHeaderInfo kSynStartHeader = {
|
|
|