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

Unified Diff: net/socket/tcp_client_socket_unittest.cc

Issue 10803027: Fix TCPClientSocket::GetLocalAddress() to work when socket is not connected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/tcp_client_socket_unittest.cc
diff --git a/net/socket/tcp_client_socket_unittest.cc b/net/socket/tcp_client_socket_unittest.cc
index c2589b81923a0922c44fd38633249b17205f05cf..4953bc61d4162c80d1918d362de4083de78941bf 100644
--- a/net/socket/tcp_client_socket_unittest.cc
+++ b/net/socket/tcp_client_socket_unittest.cc
@@ -34,6 +34,10 @@ TEST(TCPClientSocketTest, BindLoopbackToLoopback) {
EXPECT_EQ(OK, socket.Bind(IPEndPoint(lo_address, 0)));
+ IPEndPoint local_address_result;
+ EXPECT_EQ(OK, socket.GetLocalAddress(&local_address_result));
+ EXPECT_EQ(lo_address, local_address_result.address());
+
TestCompletionCallback connect_callback;
EXPECT_EQ(ERR_IO_PENDING, socket.Connect(connect_callback.callback()));

Powered by Google App Engine
This is Rietveld 408576698