From 80a09a86b207711a4009852db8c2567ec3ff8efd Mon Sep 17 00:00:00 2001 From: "phajdan.jr@chromium.org" Date: Fri, 16 Nov 2012 17:40:06 +0000 Subject: net: Pass the real IP address and port for mock TCP sockets where possible. I'll need that for my upcoming FTP CL. BUG=131847 Review URL: https://codereview.chromium.org/11280014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168237 0039d316-1c4b-4281-b951-d872f2087c98 --- net/socket/socket_test_util.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'net/socket') diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc index 407c543..590a56d 100644 --- a/net/socket/socket_test_util.cc +++ b/net/socket/socket_test_util.cc @@ -881,7 +881,11 @@ bool MockTCPClientSocket::IsConnectedAndIdle() const { } int MockTCPClientSocket::GetPeerAddress(IPEndPoint* address) const { - return MockClientSocket::GetPeerAddress(address); + if (addresses_.empty()) + return MockClientSocket::GetPeerAddress(address); + + *address = addresses_[0]; + return OK; } bool MockTCPClientSocket::WasEverUsed() const { -- cgit v1.1