diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-26 06:01:21 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-26 06:01:21 +0000 |
commit | 3ae823083442061c26aa61c72385c3e085fe2fe6 (patch) | |
tree | 4cb16dea043374ae181f23b850cc976cfcca1cb3 /net/socket/tcp_client_socket_pool_unittest.cc | |
parent | ea376ac69fd89cf237693834326acca685e7a22d (diff) | |
download | chromium_src-3ae823083442061c26aa61c72385c3e085fe2fe6.zip chromium_src-3ae823083442061c26aa61c72385c3e085fe2fe6.tar.gz chromium_src-3ae823083442061c26aa61c72385c3e085fe2fe6.tar.bz2 |
Reset internal ClientSocketHandle state on Init() synchronous error (failure to do so could lead to a crash). Also delete a CHECK that was asserting on possibly deleted memory.
BUG=http://crbug.com/15207
TEST=See bug for repro.
Review URL: http://codereview.chromium.org/147155
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19343 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/tcp_client_socket_pool_unittest.cc')
-rw-r--r-- | net/socket/tcp_client_socket_pool_unittest.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/socket/tcp_client_socket_pool_unittest.cc b/net/socket/tcp_client_socket_pool_unittest.cc index a76a439..9cd62e8 100644 --- a/net/socket/tcp_client_socket_pool_unittest.cc +++ b/net/socket/tcp_client_socket_pool_unittest.cc @@ -278,10 +278,14 @@ TEST_F(TCPClientSocketPoolTest, InitConnectionFailure) { client_socket_factory_.set_client_socket_type( MockClientSocketFactory::MOCK_FAILING_CLIENT_SOCKET); TestSocketRequest req(pool_.get(), &request_order_); - HostResolver::RequestInfo info("unresolvable.host.name", 80); + HostResolver::RequestInfo info("a", 80); EXPECT_EQ(ERR_IO_PENDING, req.handle.Init("a", info, 5, &req)); EXPECT_EQ(ERR_CONNECTION_FAILED, req.WaitForResult()); + // HostCache caches it, so MockFailingClientSocket will cause Init() to + // synchronously fail. + EXPECT_EQ(ERR_CONNECTION_FAILED, + req.handle.Init("a", info, 5, &req)); } TEST_F(TCPClientSocketPoolTest, PendingRequests) { |