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

Unified Diff: net/socket/socket_test_util.cc

Issue 10690122: Change SpdySession::GetSSLInfo to get the SSLInfo from the underlying socket (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Actual working test 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/socket_test_util.cc
diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc
index d51d5c65388ee5d2f63d76f88b191d9fe1c8b78a..1c9926ebe7817a52cf9b9e5a79b1662c0900de6f 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -704,10 +704,6 @@ const BoundNetLog& MockClientSocket::NetLog() const {
return net_log_;
}
-void MockClientSocket::GetSSLInfo(SSLInfo* ssl_info) {
- NOTREACHED();
-}
-
void MockClientSocket::GetSSLCertRequestInfo(
SSLCertRequestInfo* cert_request_info) {
}
@@ -872,6 +868,14 @@ base::TimeDelta MockTCPClientSocket::GetConnectTimeMicros() const {
return kTestingConnectTimeMicros;
}
+bool MockTCPClientSocket::WasNpnNegotiated() const {
+ return false;
+}
+
+bool MockTCPClientSocket::GetSSLInfo(SSLInfo* ssl_info) const {
+ return false;
+}
+
void MockTCPClientSocket::OnReadComplete(const MockRead& data) {
// There must be a read pending.
DCHECK(pending_buf_);
@@ -942,7 +946,9 @@ DeterministicMockTCPClientSocket::DeterministicMockTCPClientSocket(
read_buf_len_(0),
read_pending_(false),
data_(data),
- was_used_to_convey_data_(false) {}
+ was_used_to_convey_data_(false) {
+ peer_addr_ = data->connect_data().peer_addr;
+}
DeterministicMockTCPClientSocket::~DeterministicMockTCPClientSocket() {}
@@ -1069,6 +1075,14 @@ base::TimeDelta DeterministicMockTCPClientSocket::GetConnectTimeMicros() const {
return base::TimeDelta::FromMicroseconds(-1);
}
+bool DeterministicMockTCPClientSocket::WasNpnNegotiated() const {
+ return false;
+}
+
+bool DeterministicMockTCPClientSocket::GetSSLInfo(SSLInfo* ssl_info) const {
+ return false;
+}
+
void DeterministicMockTCPClientSocket::OnReadComplete(const MockRead& data) {}
// static
@@ -1156,11 +1170,12 @@ base::TimeDelta MockSSLClientSocket::GetConnectTimeMicros() const {
return base::TimeDelta::FromMicroseconds(-1);
}
-void MockSSLClientSocket::GetSSLInfo(SSLInfo* ssl_info) {
+bool MockSSLClientSocket::GetSSLInfo(SSLInfo* ssl_info) const {
ssl_info->Reset();
ssl_info->cert = data_->cert;
ssl_info->client_cert_sent = data_->client_cert_sent;
ssl_info->channel_id_sent = data_->channel_id_sent;
+ return true;
}
void MockSSLClientSocket::GetSSLCertRequestInfo(
@@ -1193,6 +1208,10 @@ bool MockSSLClientSocket::set_was_npn_negotiated(bool negotiated) {
return new_npn_value_ = negotiated;
}
+bool MockSSLClientSocket::WasNpnNegotiated() const {
+ return was_npn_negotiated();
+}
+
NextProto MockSSLClientSocket::GetNegotiatedProtocol() const {
if (is_protocol_negotiated_set_)
return protocol_negotiated_;

Powered by Google App Engine
This is Rietveld 408576698