diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-23 04:37:21 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-23 04:37:21 +0000 |
commit | 17b0006c5d67977ef7acb21fde2a2dc19dd4e32c (patch) | |
tree | 89b4bfe1e630a668ab3db761e909362e9ae89d17 /net/socket | |
parent | bb0e79474b4a2a50643901aae666a9e67ae9da8d (diff) | |
download | chromium_src-17b0006c5d67977ef7acb21fde2a2dc19dd4e32c.zip chromium_src-17b0006c5d67977ef7acb21fde2a2dc19dd4e32c.tar.gz chromium_src-17b0006c5d67977ef7acb21fde2a2dc19dd4e32c.tar.bz2 |
TransportClientSocketTest.IsConnected should wait for the server to
close the connection before checking if sock_->IsConnected() is false.
This eliminates a source of flakiness.
R=rvargas@chromium.org
BUG=144467
TEST=N/A
Review URL: https://chromiumcodereview.appspot.com/11235046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163506 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket')
-rw-r--r-- | net/socket/transport_client_socket_unittest.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/socket/transport_client_socket_unittest.cc b/net/socket/transport_client_socket_unittest.cc index 59308c5..aded7d1 100644 --- a/net/socket/transport_client_socket_unittest.cc +++ b/net/socket/transport_client_socket_unittest.cc @@ -257,8 +257,12 @@ TEST_P(TransportClientSocketTest, IsConnected) { &callback); ASSERT_EQ(bytes_read, arraysize(kServerReply) - 2); - // Once the data is drained, the socket should now be seen as - // closed. + // Once the data is drained, wait for the server socket to be closed. + rv = sock_->Read(buf, 4096, callback.callback()); + rv = callback.GetResult(rv); + EXPECT_EQ(0, rv); + + // The socket should now be seen as not connected. EXPECT_FALSE(sock_->IsConnected()); EXPECT_FALSE(sock_->IsConnectedAndIdle()); } |