summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorerikchen@google.com <erikchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 15:36:52 +0000
committererikchen@google.com <erikchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 15:36:52 +0000
commit3f485b550995d654688354eb080bde52b63cb2b0 (patch)
tree4c61a2b72bc7e8c2b3b10f42bc7d4c3c7f73094d /net
parenta1e7dc683aab37b8650305ab2990fa408ed8dfe4 (diff)
downloadchromium_src-3f485b550995d654688354eb080bde52b63cb2b0.zip
chromium_src-3f485b550995d654688354eb080bde52b63cb2b0.tar.gz
chromium_src-3f485b550995d654688354eb080bde52b63cb2b0.tar.bz2
Mac compile warning fix for r52670.
TEST=NONE BUG=NONE Review URL: http://codereview.chromium.org/3027002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52673 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/spdy/spdy_network_transaction_unittest.cc98
1 files changed, 47 insertions, 51 deletions
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc
index 88b3533..59cabb6 100644
--- a/net/spdy/spdy_network_transaction_unittest.cc
+++ b/net/spdy/spdy_network_transaction_unittest.cc
@@ -28,57 +28,6 @@
namespace net {
-namespace {
-
-// Helper to manage the lifetimes of the dependencies for a
-// HttpNetworkTransaction.
-class SessionDependencies {
- public:
- // Default set of dependencies -- "null" proxy service.
- SessionDependencies()
- : host_resolver(new MockHostResolver),
- proxy_service(ProxyService::CreateNull()),
- ssl_config_service(new SSLConfigServiceDefaults),
- http_auth_handler_factory(HttpAuthHandlerFactory::CreateDefault()),
- spdy_session_pool(new SpdySessionPool()) {
- // Note: The CancelledTransaction test does cleanup by running all tasks
- // in the message loop (RunAllPending). Unfortunately, that doesn't clean
- // up tasks on the host resolver thread; and TCPConnectJob is currently
- // not cancellable. Using synchronous lookups allows the test to shutdown
- // cleanly. Until we have cancellable TCPConnectJobs, use synchronous
- // lookups.
- host_resolver->set_synchronous_mode(true);
- }
-
- // 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);
-}
-
-} // namespace
-
class SpdyNetworkTransactionTest : public PlatformTest {
protected:
virtual void SetUp() {
@@ -112,6 +61,53 @@ class SpdyNetworkTransactionTest : public PlatformTest {
class StartTransactionCallback;
class DeleteSessionCallback;
+ // Helper to manage the lifetimes of the dependencies for a
+ // HttpNetworkTransaction.
+ class SessionDependencies {
+ public:
+ // Default set of dependencies -- "null" proxy service.
+ SessionDependencies()
+ : host_resolver(new MockHostResolver),
+ proxy_service(ProxyService::CreateNull()),
+ ssl_config_service(new SSLConfigServiceDefaults),
+ http_auth_handler_factory(HttpAuthHandlerFactory::CreateDefault()),
+ spdy_session_pool(new SpdySessionPool()) {
+ // Note: The CancelledTransaction test does cleanup by running all
+ // tasks in the message loop (RunAllPending). Unfortunately, that
+ // doesn't clean up tasks on the host resolver thread; and
+ // TCPConnectJob is currently not cancellable. Using synchronous
+ // lookups allows the test to shutdown cleanly. Until we have
+ // cancellable TCPConnectJobs, use synchronous lookups.
+ host_resolver->set_synchronous_mode(true);
+ }
+
+ // 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;
+ };
+
+ static 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);
+ }
+
// A helper class that handles all the initial npn/ssl setup.
class NormalSpdyTransactionHelper {
public: