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

Unified Diff: net/socket/socket_test_util.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/connection_attempts.h ('k') | net/socket/ssl_client_socket_pool.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 a4557a96f0355ac1663550d854210e17a251599f..78cbae6250aebe246fece585f7af5e1ee205b704 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -1942,9 +1942,9 @@ MockTransportClientSocketPool::MockConnectJob::~MockConnectJob() {}
int MockTransportClientSocketPool::MockConnectJob::Connect() {
int rv = socket_->Connect(base::Bind(&MockConnectJob::OnConnect,
base::Unretained(this)));
- if (rv == OK) {
+ if (rv != ERR_IO_PENDING) {
user_callback_.Reset();
- OnConnect(OK);
+ OnConnect(rv);
}
return rv;
}
@@ -1976,6 +1976,11 @@ void MockTransportClientSocketPool::MockConnectJob::OnConnect(int rv) {
handle_->set_connect_timing(connect_timing);
} else {
socket_.reset();
+
+ // Needed to test copying of ConnectionAttempts in SSL ConnectJob.
+ ConnectionAttempts attempts;
+ attempts.push_back(ConnectionAttempt(IPEndPoint(), rv));
+ handle_->set_connection_attempts(attempts);
}
handle_ = NULL;
« no previous file with comments | « net/socket/connection_attempts.h ('k') | net/socket/ssl_client_socket_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698