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

Unified Diff: net/socket/transport_client_socket_pool_unittest.cc

Issue 1006643002: Plumb connection attempts from (non-proxy) ConnectJobs to HttpNetworkTransaction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, resolve conflict Created 5 years, 8 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
« no previous file with comments | « net/socket/transport_client_socket_pool.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/transport_client_socket_pool_unittest.cc
diff --git a/net/socket/transport_client_socket_pool_unittest.cc b/net/socket/transport_client_socket_pool_unittest.cc
index a14e4ef16475f651fb9fbd6a303c072dbfea7db5..dbfc5064c60634ffb77ed28c92c471432ff9bc2c 100644
--- a/net/socket/transport_client_socket_pool_unittest.cc
+++ b/net/socket/transport_client_socket_pool_unittest.cc
@@ -185,6 +185,7 @@ TEST_F(TransportClientSocketPoolTest, Basic) {
EXPECT_TRUE(handle.is_initialized());
EXPECT_TRUE(handle.socket());
TestLoadTimingInfoConnectedNotReused(handle);
+ EXPECT_EQ(0u, handle.connection_attempts().size());
}
// Make sure that TransportConnectJob passes on its priority to its
@@ -213,6 +214,9 @@ TEST_F(TransportClientSocketPoolTest, InitHostResolutionFailure) {
handle.Init("a", dest, kDefaultPriority, callback.callback(),
&pool_, BoundNetLog()));
EXPECT_EQ(ERR_NAME_NOT_RESOLVED, callback.WaitForResult());
+ ASSERT_EQ(1u, handle.connection_attempts().size());
+ EXPECT_TRUE(handle.connection_attempts()[0].endpoint.address().empty());
+ EXPECT_EQ(ERR_NAME_NOT_RESOLVED, handle.connection_attempts()[0].result);
}
TEST_F(TransportClientSocketPoolTest, InitConnectionFailure) {
@@ -224,12 +228,20 @@ TEST_F(TransportClientSocketPoolTest, InitConnectionFailure) {
handle.Init("a", params_, kDefaultPriority, callback.callback(),
&pool_, BoundNetLog()));
EXPECT_EQ(ERR_CONNECTION_FAILED, callback.WaitForResult());
+ ASSERT_EQ(1u, handle.connection_attempts().size());
+ EXPECT_EQ("127.0.0.1:80",
+ handle.connection_attempts()[0].endpoint.ToString());
+ EXPECT_EQ(ERR_CONNECTION_FAILED, handle.connection_attempts()[0].result);
// Make the host resolutions complete synchronously this time.
host_resolver_->set_synchronous_mode(true);
EXPECT_EQ(ERR_CONNECTION_FAILED,
handle.Init("a", params_, kDefaultPriority, callback.callback(),
&pool_, BoundNetLog()));
+ ASSERT_EQ(1u, handle.connection_attempts().size());
+ EXPECT_EQ("127.0.0.1:80",
+ handle.connection_attempts()[0].endpoint.ToString());
+ EXPECT_EQ(ERR_CONNECTION_FAILED, handle.connection_attempts()[0].result);
}
TEST_F(TransportClientSocketPoolTest, PendingRequests) {
« no previous file with comments | « net/socket/transport_client_socket_pool.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698