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

Unified Diff: net/spdy/spdy_test_util_common.cc

Issue 17760008: [SPDY] Enable tests for SPDY/3.1 and SPDY/4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 6 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/spdy/spdy_test_util_common.h ('k') | net/spdy/spdy_websocket_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_test_util_common.cc
diff --git a/net/spdy/spdy_test_util_common.cc b/net/spdy/spdy_test_util_common.cc
index 43ee5de8b91bfec8bf744f1e4eb70c32f60a5ce5..919dd45410fc1297b8a8ca4eee82ad957d129530 100644
--- a/net/spdy/spdy_test_util_common.cc
+++ b/net/spdy/spdy_test_util_common.cc
@@ -16,6 +16,7 @@
#include "net/http/http_network_transaction.h"
#include "net/http/http_server_properties_impl.h"
#include "net/socket/socket_test_util.h"
+#include "net/socket/ssl_client_socket.h"
#include "net/spdy/buffered_spdy_framer.h"
#include "net/spdy/spdy_framer.h"
#include "net/spdy/spdy_http_utils.h"
@@ -47,6 +48,15 @@ void ParseUrl(base::StringPiece url, std::string* scheme, std::string* host,
} // namespace
+std::vector<std::string> SpdyNextProtos() {
+ std::vector<std::string> next_protos;
+ for (int i = kProtoMinimumVersion; i <= kProtoMaximumVersion; ++i) {
+ next_protos.push_back(SSLClientSocket::NextProtoToString(
+ static_cast<NextProto>(i)));
+ }
+ return next_protos;
+}
+
// Chop a frame into an array of MockWrites.
// |data| is the frame to chop.
// |length| is the length of the frame to chop.
@@ -524,6 +534,28 @@ SpdyMajorVersion SpdyVersionFromNextProto(NextProto next_proto) {
}
}
+AlternateProtocol AlternateProtocolFromNextProto(NextProto next_proto) {
+ switch (next_proto) {
+ case kProtoSPDY2:
+ return NPN_SPDY_2;
+ case kProtoSPDY3:
+ return NPN_SPDY_3;
+ case kProtoSPDY31:
+ return NPN_SPDY_3_1;
+ case kProtoSPDY4a2:
+ return NPN_SPDY_4A2;
+
+ case kProtoUnknown:
+ case kProtoHTTP11:
+ case kProtoSPDY1:
+ case kProtoSPDY21:
+ break;
+ }
+
+ NOTREACHED();
+ return NPN_SPDY_2;
+}
+
SpdyTestUtil::SpdyTestUtil(NextProto protocol)
: protocol_(protocol),
spdy_version_(SpdyVersionFromNextProto(protocol)) {
« no previous file with comments | « net/spdy/spdy_test_util_common.h ('k') | net/spdy/spdy_websocket_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698