Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Unified Diff: net/socket/client_socket_pool_base_unittest.cc

Issue 981643002: Fix bug that would create unnecessary ConnectJobs in some cases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix stuff Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/socket/client_socket_pool_base_unittest.cc
diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc
index c4a28459a1ebd717cb97cdac07e63fa7e86659e7..c7cbda1562f00cc2e417cb25b4322e92dfdcf193 100644
--- a/net/socket/client_socket_pool_base_unittest.cc
+++ b/net/socket/client_socket_pool_base_unittest.cc
@@ -1750,6 +1750,22 @@ TEST_F(ClientSocketPoolBaseTest,
entries, 2, NetLog::TYPE_SOCKET_POOL));
}
+// Check that an async ConnectJob failure does not result in creation of a new
+// ConnectJob when there's another pending request also waiting on its own
+// ConnectJob. See http://crbug.com/463960.
+TEST_F(ClientSocketPoolBaseTest, AsyncFailureWithPendingRequestWithJob) {
+ CreatePool(2, 2);
+ connect_job_factory_->set_job_type(TestConnectJob::kMockPendingFailingJob);
+
+ EXPECT_EQ(ERR_IO_PENDING, StartRequest("a", DEFAULT_PRIORITY));
+ EXPECT_EQ(ERR_IO_PENDING, StartRequest("a", DEFAULT_PRIORITY));
+
+ EXPECT_EQ(ERR_CONNECTION_FAILED, request(0)->WaitForResult());
+ EXPECT_EQ(ERR_CONNECTION_FAILED, request(1)->WaitForResult());
+
+ EXPECT_EQ(2, client_socket_factory_.allocation_count());
+}
+
TEST_F(ClientSocketPoolBaseTest, TwoRequestsCancelOne) {
// TODO(eroman): Add back the log expectations! Removed them because the
// ordering is difficult, and some may fire during destructor.
« net/socket/client_socket_pool_base.cc ('K') | « net/socket/client_socket_pool_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698