diff options
author | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 03:51:20 +0000 |
---|---|---|
committer | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 03:51:20 +0000 |
commit | 1ad77dc23b51198e2b0ce4ba0f8a55635b25474c (patch) | |
tree | 2898a3bfd758ae1f5e3583acdc349dcb88b68ae6 /net/http | |
parent | 55e31b02ec039da2a348c618f5683ea2af686287 (diff) | |
download | chromium_src-1ad77dc23b51198e2b0ce4ba0f8a55635b25474c.zip chromium_src-1ad77dc23b51198e2b0ce4ba0f8a55635b25474c.tar.gz chromium_src-1ad77dc23b51198e2b0ce4ba0f8a55635b25474c.tar.bz2 |
SPDY - Change all tests to use SPDY/2.1 protocol. Made
changes to SPDY code to support enabling or disabling
flow_control independent of NPN protocol negotiated.
TEST=network unit tests
R=wtc
Review URL: http://codereview.chromium.org/9252029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119360 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r-- | net/http/http_network_layer.cc | 5 | ||||
-rw-r--r-- | net/http/http_network_transaction_unittest.cc | 94 | ||||
-rw-r--r-- | net/http/http_pipelined_host_impl_unittest.cc | 6 | ||||
-rw-r--r-- | net/http/http_proxy_client_socket_pool_unittest.cc | 4 | ||||
-rw-r--r-- | net/http/http_server_properties_impl_unittest.cc | 8 | ||||
-rw-r--r-- | net/http/http_stream_factory_impl.cc | 4 |
6 files changed, 61 insertions, 60 deletions
diff --git a/net/http/http_network_layer.cc b/net/http/http_network_layer.cc index 5690f6d..672700f 100644 --- a/net/http/http_network_layer.cc +++ b/net/http/http_network_layer.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -101,6 +101,7 @@ void HttpNetworkLayer::EnableSpdy(const std::string& mode) { std::vector<std::string> next_protos; next_protos.push_back("http/1.1"); next_protos.push_back("spdy/2"); + next_protos.push_back("spdy/2.1"); HttpStreamFactory::set_next_protos(next_protos); } else if (option == kEnableNpnHttpOnly) { // Avoid alternate protocol in this case. Otherwise, browser will try SSL @@ -129,7 +130,7 @@ void HttpNetworkLayer::EnableSpdy(const std::string& mode) { } else if (option == kForceAltProtocols) { PortAlternateProtocolPair pair; pair.port = 443; - pair.protocol = NPN_SPDY_2; + pair.protocol = NPN_SPDY_21; HttpServerPropertiesImpl::ForceAlternateProtocol(pair); } else if (option == kSingleDomain) { SpdySessionPool::ForceSingleDomain(); diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index 8dda238..c522e8b 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -377,7 +377,7 @@ CaptureGroupNameSSLSocketPool::CaptureGroupNameSocketPool( // This is the expected return from a current server advertising SPDY. static const char kAlternateProtocolHttpHeader[] = - "Alternate-Protocol: 443:npn-spdy/2\r\n\r\n"; + "Alternate-Protocol: 443:npn-spdy/2.1\r\n\r\n"; // Helper functions for validating that AuthChallengeInfo's are correctly // configured for common cases. @@ -2541,9 +2541,9 @@ TEST_F(HttpNetworkTransactionTest, HttpsProxySpdyGet) { SSLSocketDataProvider ssl(true, OK); ssl.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl.next_proto = "spdy/2"; + ssl.next_proto = "spdy/2.1"; ssl.was_npn_negotiated = true; - ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); TestCompletionCallback callback1; @@ -2628,9 +2628,9 @@ TEST_F(HttpNetworkTransactionTest, HttpsProxySpdyGetWithProxyAuth) { SSLSocketDataProvider ssl(true, OK); ssl.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl.next_proto = "spdy/2"; + ssl.next_proto = "spdy/2.1"; ssl.was_npn_negotiated = true; - ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); TestCompletionCallback callback1; @@ -2723,9 +2723,9 @@ TEST_F(HttpNetworkTransactionTest, HttpsProxySpdyConnectHttps) { SSLSocketDataProvider ssl(true, OK); ssl.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl.next_proto = "spdy/2"; + ssl.next_proto = "spdy/2.1"; ssl.was_npn_negotiated = true; - ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); SSLSocketDataProvider ssl2(true, OK); ssl2.was_npn_negotiated = false; @@ -2798,15 +2798,15 @@ TEST_F(HttpNetworkTransactionTest, HttpsProxySpdyConnectSpdy) { SSLSocketDataProvider ssl(true, OK); ssl.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl.next_proto = "spdy/2"; + ssl.next_proto = "spdy/2.1"; ssl.was_npn_negotiated = true; - ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); SSLSocketDataProvider ssl2(true, OK); ssl2.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl2.next_proto = "spdy/2"; + ssl2.next_proto = "spdy/2.1"; ssl2.was_npn_negotiated = true; - ssl2.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl2.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl2); TestCompletionCallback callback1; @@ -2867,15 +2867,15 @@ TEST_F(HttpNetworkTransactionTest, HttpsProxySpdyConnectFailure) { SSLSocketDataProvider ssl(true, OK); ssl.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl.next_proto = "spdy/2"; + ssl.next_proto = "spdy/2.1"; ssl.was_npn_negotiated = true; - ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); SSLSocketDataProvider ssl2(true, OK); ssl2.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl2.next_proto = "spdy/2"; + ssl2.next_proto = "spdy/2.1"; ssl2.was_npn_negotiated = true; - ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl2); TestCompletionCallback callback1; @@ -5269,9 +5269,9 @@ TEST_F(HttpNetworkTransactionTest, RedirectOfHttpsConnectViaSpdyProxy) { data_writes, arraysize(data_writes))); SSLSocketDataProvider proxy_ssl(true, OK); // SSL to the proxy proxy_ssl.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - proxy_ssl.next_proto = "spdy/2"; + proxy_ssl.next_proto = "spdy/2.1"; proxy_ssl.was_npn_negotiated = true; - proxy_ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + proxy_ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSocketDataProvider(data.get()); session_deps.socket_factory.AddSSLSocketDataProvider(&proxy_ssl); @@ -5389,9 +5389,9 @@ TEST_F(HttpNetworkTransactionTest, ErrorResponseTofHttpsConnectViaSpdyProxy) { data_writes, arraysize(data_writes))); SSLSocketDataProvider proxy_ssl(true, OK); // SSL to the proxy proxy_ssl.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - proxy_ssl.next_proto = "spdy/2"; + proxy_ssl.next_proto = "spdy/2.1"; proxy_ssl.was_npn_negotiated = true; - proxy_ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + proxy_ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSocketDataProvider(data.get()); session_deps.socket_factory.AddSSLSocketDataProvider(&proxy_ssl); @@ -6145,7 +6145,7 @@ scoped_refptr<HttpNetworkSession> SetupSessionForGroupNameTests( session->http_server_properties(); http_server_properties->SetAlternateProtocol( HostPortPair("host.with.alternate", 80), 443, - NPN_SPDY_2); + NPN_SPDY_21); return session; } @@ -7085,7 +7085,7 @@ TEST_F(HttpNetworkTransactionTest, HonorAlternateProtocolHeader) { http_server_properties.GetAlternateProtocol(http_host_port_pair); PortAlternateProtocolPair expected_alternate; expected_alternate.port = 443; - expected_alternate.protocol = NPN_SPDY_2; + expected_alternate.protocol = NPN_SPDY_21; EXPECT_TRUE(expected_alternate.Equals(alternate)); HttpStreamFactory::set_use_alternate_protocols(false); @@ -7124,7 +7124,7 @@ TEST_F(HttpNetworkTransactionTest, MarkBrokenAlternateProtocolAndFallback) { http_server_properties->SetAlternateProtocol( HostPortPair::FromURL(request.url), 666 /* port is ignored by MockConnect anyway */, - NPN_SPDY_2); + NPN_SPDY_21); scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); TestCompletionCallback callback; @@ -7186,7 +7186,7 @@ TEST_F(HttpNetworkTransactionTest, AlternateProtocolPortRestrictedBlocked) { http_server_properties->SetAlternateProtocol( HostPortPair::FromURL(restricted_port_request.url), kUnrestrictedAlternatePort, - NPN_SPDY_2); + NPN_SPDY_21); scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); TestCompletionCallback callback; @@ -7235,7 +7235,7 @@ TEST_F(HttpNetworkTransactionTest, AlternateProtocolPortRestrictedAllowed) { http_server_properties->SetAlternateProtocol( HostPortPair::FromURL(restricted_port_request.url), kRestrictedAlternatePort, - NPN_SPDY_2); + NPN_SPDY_21); scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); TestCompletionCallback callback; @@ -7284,7 +7284,7 @@ TEST_F(HttpNetworkTransactionTest, AlternateProtocolPortUnrestrictedAllowed1) { http_server_properties->SetAlternateProtocol( HostPortPair::FromURL(unrestricted_port_request.url), kRestrictedAlternatePort, - NPN_SPDY_2); + NPN_SPDY_21); scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); TestCompletionCallback callback; @@ -7333,7 +7333,7 @@ TEST_F(HttpNetworkTransactionTest, AlternateProtocolPortUnrestrictedAllowed2) { http_server_properties->SetAlternateProtocol( HostPortPair::FromURL(unrestricted_port_request.url), kUnrestrictedAlternatePort, - NPN_SPDY_2); + NPN_SPDY_21); scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); TestCompletionCallback callback; @@ -7424,9 +7424,9 @@ TEST_F(HttpNetworkTransactionTest, UseAlternateProtocolForNpnSpdy) { SSLSocketDataProvider ssl(true, OK); ssl.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl.next_proto = "spdy/2"; + ssl.next_proto = "spdy/2.1"; ssl.was_npn_negotiated = true; - ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); @@ -7526,9 +7526,9 @@ TEST_F(HttpNetworkTransactionTest, AlternateProtocolWithSpdyLateBinding) { SSLSocketDataProvider ssl(true, OK); ssl.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl.next_proto = "spdy/2"; + ssl.next_proto = "spdy/2.1"; ssl.was_npn_negotiated = true; - ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); scoped_ptr<spdy::SpdyFrame> req1(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); @@ -7635,9 +7635,9 @@ TEST_F(HttpNetworkTransactionTest, StallAlternateProtocolForNpnSpdy) { SSLSocketDataProvider ssl(true, OK); ssl.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl.next_proto = "spdy/2"; + ssl.next_proto = "spdy/2.1"; ssl.was_npn_negotiated = true; - ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); MockConnect never_finishing_connect(false, ERR_IO_PENDING); @@ -7770,9 +7770,9 @@ TEST_F(HttpNetworkTransactionTest, UseAlternateProtocolForTunneledNpnSpdy) { SSLSocketDataProvider ssl(true, OK); ssl.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl.next_proto = "spdy/2"; + ssl.next_proto = "spdy/2.1"; ssl.was_npn_negotiated = true; - ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); @@ -7877,9 +7877,9 @@ TEST_F(HttpNetworkTransactionTest, SSLSocketDataProvider ssl(true, OK); ssl.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl.next_proto = "spdy/2"; + ssl.next_proto = "spdy/2.1"; ssl.was_npn_negotiated = true; - ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); // Make sure we use ssl for spdy here. SpdySession::SetSSLMode(true); @@ -8764,9 +8764,9 @@ TEST_F(HttpNetworkTransactionTest, SpdyPostNPNServerHangup) { SSLSocketDataProvider ssl(true, OK); ssl.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl.next_proto = "spdy/2"; + ssl.next_proto = "spdy/2.1"; ssl.was_npn_negotiated = true; - ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); @@ -8827,7 +8827,7 @@ TEST_F(HttpNetworkTransactionTest, SpdyAlternateProtocolThroughProxy) { MockRead data_reads_1[] = { MockRead(false, ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ), MockRead("HTTP/1.1 200 OK\r\n" - "Alternate-Protocol: 443:npn-spdy/2\r\n" + "Alternate-Protocol: 443:npn-spdy/2.1\r\n" "Proxy-Connection: close\r\n" "\r\n"), }; @@ -8920,9 +8920,9 @@ TEST_F(HttpNetworkTransactionTest, SpdyAlternateProtocolThroughProxy) { SSLSocketDataProvider ssl(true, OK); ssl.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl.next_proto = "spdy/2"; + ssl.next_proto = "spdy/2.1"; ssl.was_npn_negotiated = true; - ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; MockConnect never_finishing_connect(false, ERR_IO_PENDING); StaticSocketDataProvider hanging_non_alternate_protocol_socket( @@ -9207,9 +9207,9 @@ TEST_F(HttpNetworkTransactionTest, PreconnectWithExistingSpdySession) { SSLSocketDataProvider ssl(true, OK); ssl.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl.next_proto = "spdy/2"; + ssl.next_proto = "spdy/2.1"; ssl.was_npn_negotiated = true; - ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); @@ -9644,9 +9644,9 @@ TEST_F(HttpNetworkTransactionTest, UseIPConnectionPooling) { SSLSocketDataProvider ssl(true, OK); ssl.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl.next_proto = "spdy/2"; + ssl.next_proto = "spdy/2.1"; ssl.was_npn_negotiated = true; - ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); scoped_ptr<spdy::SpdyFrame> host1_req(ConstructSpdyGet( @@ -9798,9 +9798,9 @@ TEST_F(HttpNetworkTransactionTest, SSLSocketDataProvider ssl(true, OK); ssl.next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl.next_proto = "spdy/2"; + ssl.next_proto = "spdy/2.1"; ssl.was_npn_negotiated = true; - ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY21; session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); scoped_ptr<spdy::SpdyFrame> host1_req(ConstructSpdyGet( diff --git a/net/http/http_pipelined_host_impl_unittest.cc b/net/http/http_pipelined_host_impl_unittest.cc index c52d573e..48107b5 100644 --- a/net/http/http_pipelined_host_impl_unittest.cc +++ b/net/http/http_pipelined_host_impl_unittest.cc @@ -103,7 +103,7 @@ class HttpPipelinedHostImplTest : public testing::Test { MatchesOrigin(origin_), Ref(ssl_config_), Ref(proxy_info_), Ref(net_log_), true, - SSLClientSocket::kProtoSPDY2)) + SSLClientSocket::kProtoSPDY21)) .Times(1) .WillOnce(Return(pipeline)); EXPECT_CALL(*pipeline, CreateNewStream()) @@ -111,7 +111,7 @@ class HttpPipelinedHostImplTest : public testing::Test { .WillOnce(Return(kDummyStream)); EXPECT_EQ(kDummyStream, host_->CreateStreamOnNewPipeline( kDummyConnection, ssl_config_, proxy_info_, net_log_, true, - SSLClientSocket::kProtoSPDY2)); + SSLClientSocket::kProtoSPDY21)); return pipeline; } @@ -263,7 +263,7 @@ TEST_F(HttpPipelinedHostImplTest, ShutsDownOnOldVersion) { ClearTestPipeline(pipeline); EXPECT_EQ(NULL, host_->CreateStreamOnNewPipeline( kDummyConnection, ssl_config_, proxy_info_, net_log_, true, - SSLClientSocket::kProtoSPDY2)); + SSLClientSocket::kProtoSPDY21)); } TEST_F(HttpPipelinedHostImplTest, ShutsDownOnAuthenticationRequired) { diff --git a/net/http/http_proxy_client_socket_pool_unittest.cc b/net/http/http_proxy_client_socket_pool_unittest.cc index ba7b6b5..bf5b418 100644 --- a/net/http/http_proxy_client_socket_pool_unittest.cc +++ b/net/http/http_proxy_client_socket_pool_unittest.cc @@ -176,9 +176,9 @@ class HttpProxyClientSocketPoolTest : public TestWithHttpParam { void InitializeSpdySsl() { spdy::SpdyFramer::set_enable_compression_default(false); ssl_data_->next_proto_status = SSLClientSocket::kNextProtoNegotiated; - ssl_data_->next_proto = "spdy/2"; + ssl_data_->next_proto = "spdy/2.1"; ssl_data_->was_npn_negotiated = true; - ssl_data_->protocol_negotiated = SSLClientSocket::kProtoSPDY2; + ssl_data_->protocol_negotiated = SSLClientSocket::kProtoSPDY21; } HttpNetworkSession* CreateNetworkSession() { diff --git a/net/http/http_server_properties_impl_unittest.cc b/net/http/http_server_properties_impl_unittest.cc index a3bb781..724dea0 100644 --- a/net/http/http_server_properties_impl_unittest.cc +++ b/net/http/http_server_properties_impl_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -212,7 +212,7 @@ TEST_F(AlternateProtocolServerPropertiesTest, Initialize) { AlternateProtocolMap alternate_protocol_map; PortAlternateProtocolPair port_alternate_protocol_pair; port_alternate_protocol_pair.port = 123; - port_alternate_protocol_pair.protocol = NPN_SPDY_2; + port_alternate_protocol_pair.protocol = NPN_SPDY_21; alternate_protocol_map[test_host_port_pair2] = port_alternate_protocol_pair; impl_.InitializeAlternateProtocolServers(&alternate_protocol_map); @@ -224,7 +224,7 @@ TEST_F(AlternateProtocolServerPropertiesTest, Initialize) { port_alternate_protocol_pair = impl_.GetAlternateProtocol(test_host_port_pair2); EXPECT_EQ(123, port_alternate_protocol_pair.port); - EXPECT_EQ(NPN_SPDY_2, port_alternate_protocol_pair.protocol); + EXPECT_EQ(NPN_SPDY_21, port_alternate_protocol_pair.protocol); } TEST_F(AlternateProtocolServerPropertiesTest, SetBroken) { @@ -249,7 +249,7 @@ TEST_F(AlternateProtocolServerPropertiesTest, Forced) { PortAlternateProtocolPair default_protocol; default_protocol.port = 1234; - default_protocol.protocol = NPN_SPDY_2; + default_protocol.protocol = NPN_SPDY_21; HttpServerPropertiesImpl::ForceAlternateProtocol(default_protocol); // Verify the forced protocol. diff --git a/net/http/http_stream_factory_impl.cc b/net/http/http_stream_factory_impl.cc index 9ef81b1..2e817f6 100644 --- a/net/http/http_stream_factory_impl.cc +++ b/net/http/http_stream_factory_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -156,7 +156,7 @@ bool HttpStreamFactoryImpl::GetAlternateProtocolRequestFor( DCHECK_LE(NPN_SPDY_1, alternate.protocol); DCHECK_GT(NUM_ALTERNATE_PROTOCOLS, alternate.protocol); - if (alternate.protocol != NPN_SPDY_2) + if (alternate.protocol < NPN_SPDY_2) return false; // Some shared unix systems may have user home directories (like |