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

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: rebase 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..cf2cfcf6fcc211bffcaa2180847c50e41b801fb4 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,21 @@ bool MockSSLClientSocket::GetSSLInfo(SSLInfo* ssl_info) {
return true;
}
+bool MockSSLClientSocket::was_spdy_negotiated() const {
mmenke 2013/06/03 21:10:18 This should be WasSpdyNegotiated, since it's not a
yhirano 2013/06/04 02:20:13 Since it is a derived function, I have no choice (
+ if (was_spdy_negotiated_set_)
+ return was_spdy_negotiated_;
+ return
+ WasNpnNegotiated() &&
mmenke 2013/06/03 21:10:18 nit: Suggest putting this on the previous line (r
yhirano 2013/06/04 02:20:13 Done.
+ kProtoSPDYMinimumVersion <= GetNegotiatedProtocol() &&
+ GetNegotiatedProtocol() <= kProtoSPDYMaximumVersion;
mmenke 2013/06/03 21:10:18 I find this confusing - since we have set_was_spdy
yhirano 2013/06/04 02:20:13 Done.
+}
+
+bool MockSSLClientSocket::set_was_spdy_negotiated(bool negotiated) {
mmenke 2013/06/03 21:10:18 It's my understanding that, according to the Googl
yhirano 2013/06/04 02:20:13 Moving the implementation into the header causes a
mmenke 2013/06/05 00:01:20 Sorry, didn't notice they were virtual. I may fix
+ 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