| 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)) {
|
|
|