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

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: Add a few more tests 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
Index: net/socket/socket_test_util.cc
diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc
index 79b7a34e2698bd72a372debd33242766438df360..560fadbf97350d9ca7ad985e537b650352e5e6da 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -1981,9 +1981,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;
}
@@ -2015,6 +2015,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;

Powered by Google App Engine
This is Rietveld 408576698