diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-04 00:07:04 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-04 00:07:04 +0000 |
commit | 17a0c6c711c483a0b8e77adbb3f28adc5cd5c432 (patch) | |
tree | c76fe085284fe64b95bd1e6be688f0673641d0f1 /net/socket | |
parent | 91331289a995eef199a0f3d715f306b3b92a1e6b (diff) | |
download | chromium_src-17a0c6c711c483a0b8e77adbb3f28adc5cd5c432.zip chromium_src-17a0c6c711c483a0b8e77adbb3f28adc5cd5c432.tar.gz chromium_src-17a0c6c711c483a0b8e77adbb3f28adc5cd5c432.tar.bz2 |
Fix leak in ClientSocketPoolBaseTest. Don't create ConnectJobFactory unless needed.
Review URL: http://codereview.chromium.org/159831
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22349 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket')
-rw-r--r-- | net/socket/client_socket_pool_base_unittest.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc index 6ccc2e4..d922b2b 100644 --- a/net/socket/client_socket_pool_base_unittest.cc +++ b/net/socket/client_socket_pool_base_unittest.cc @@ -334,12 +334,11 @@ class TestConnectJobDelegate : public ConnectJob::Delegate { class ClientSocketPoolBaseTest : public ClientSocketPoolTest { protected: - ClientSocketPoolBaseTest() - : connect_job_factory_( - new TestConnectJobFactory(&client_socket_factory_)) {} + ClientSocketPoolBaseTest() {} void CreatePool(int max_sockets, int max_sockets_per_group) { DCHECK(!pool_.get()); + connect_job_factory_ = new TestConnectJobFactory(&client_socket_factory_); pool_ = new TestClientSocketPool(max_sockets, max_sockets_per_group, connect_job_factory_); @@ -363,7 +362,7 @@ class ClientSocketPoolBaseTest : public ClientSocketPoolTest { } MockClientSocketFactory client_socket_factory_; - TestConnectJobFactory* const connect_job_factory_; + TestConnectJobFactory* connect_job_factory_; scoped_refptr<TestClientSocketPool> pool_; }; @@ -1289,10 +1288,10 @@ TEST_F(ClientSocketPoolBaseTest_LateBinding, CancelRequest) { } TEST_F(ClientSocketPoolBaseTest_LateBinding, CancelRequestLimitsJobs) { - connect_job_factory_->set_job_type(TestConnectJob::kMockPendingJob); - CreatePool(kDefaultMaxSockets, kDefaultMaxSocketsPerGroup); + connect_job_factory_->set_job_type(TestConnectJob::kMockPendingJob); + EXPECT_EQ(ERR_IO_PENDING, StartRequest("a", 1)); EXPECT_EQ(ERR_IO_PENDING, StartRequest("a", 2)); EXPECT_EQ(ERR_IO_PENDING, StartRequest("a", 3)); |