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

Unified Diff: net/socket/socket_test_util.cc

Issue 14813024: Introduce RequestWebSocketStream into HttpStreamFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 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 a14ab2a5d2cd58f9432faa312bf1e522253d3c05..fc31e45b4b5fce4aded6a42fef84e58bc918688d 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -1285,6 +1285,8 @@ MockSSLClientSocket::MockSSLClientSocket(
is_npn_state_set_(false),
new_npn_value_(false),
is_protocol_negotiated_set_(false),
+ was_spdy_negotiated_(false),
+ was_spdy_negotiated_set_(false),
protocol_negotiated_(kProtoUnknown) {
DCHECK(data_);
peer_addr_ = data->connect.peer_addr;
@@ -1349,6 +1351,22 @@ bool MockSSLClientSocket::GetSSLInfo(SSLInfo* ssl_info) {
return true;
}
+bool MockSSLClientSocket::was_spdy_negotiated() const {
+ // If the value is set explicitly, use the value.
+ if (was_spdy_negotiated_set_)
+ return was_spdy_negotiated_;
+ // Otherwise derive the value from other information.
mmenke 2013/06/05 00:01:20 Still not following why this is needed - all tests
yhirano 2013/06/06 14:06:43 You are right. Done.
+ return WasNpnNegotiated() &&
+ kProtoSPDYMinimumVersion <= GetNegotiatedProtocol() &&
+ GetNegotiatedProtocol() <= kProtoSPDYMaximumVersion;
+}
+
+bool MockSSLClientSocket::set_was_spdy_negotiated(bool negotiated) {
+ was_spdy_negotiated_set_ = true;
+ was_spdy_negotiated_ = negotiated;
+ return was_spdy_negotiated_;
+}
+
void MockSSLClientSocket::GetSSLCertRequestInfo(
SSLCertRequestInfo* cert_request_info) {
DCHECK(cert_request_info);

Powered by Google App Engine
This is Rietveld 408576698