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

Unified Diff: net/socket/socket_test_util.cc

Issue 598071: Really connect to the same server in FTP network transaction. (Closed)
Patch Set: updates Created 10 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
« no previous file with comments | « net/socket/socket_test_util.h ('k') | net/socket/socks5_client_socket.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/socket_test_util.cc
diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc
index 1ea1ec96fc22ed73a6f2d7e570ad7c2671df1444..16341069022d75fc5675cdd46253f22065e33387 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -9,6 +9,8 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/message_loop.h"
+#include "net/base/address_family.h"
+#include "net/base/host_resolver_proc.h"
#include "net/base/ssl_info.h"
#include "net/socket/socket.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -47,9 +49,9 @@ bool MockClientSocket::IsConnectedAndIdle() const {
return connected_;
}
-int MockClientSocket::GetPeerName(struct sockaddr* name, socklen_t* namelen) {
- memset(reinterpret_cast<char *>(name), 0, *namelen);
- return net::OK;
+int MockClientSocket::GetPeerAddress(AddressList* address) const {
+ return net::SystemHostResolverProc("localhost", ADDRESS_FAMILY_UNSPECIFIED,
+ address);
}
void MockClientSocket::RunCallbackAsync(net::CompletionCallback* callback,
@@ -370,12 +372,14 @@ void MockClientSocketFactory::ResetNextMockIndexes() {
}
MockTCPClientSocket* MockClientSocketFactory::GetMockTCPClientSocket(
- int index) const {
+ size_t index) const {
+ DCHECK_LT(index, tcp_client_sockets_.size());
return tcp_client_sockets_[index];
}
MockSSLClientSocket* MockClientSocketFactory::GetMockSSLClientSocket(
- int index) const {
+ size_t index) const {
+ DCHECK_LT(index, ssl_client_sockets_.size());
return ssl_client_sockets_[index];
}
« no previous file with comments | « net/socket/socket_test_util.h ('k') | net/socket/socks5_client_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698