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

Unified Diff: net/spdy/chromium/spdy_session_unittest.cc

Issue 2955673002: Filter QUIC alternative service if the versions advertised by the server (Closed)
Patch Set: address comments #7 Created 3 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/chromium/spdy_session_pool.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/chromium/spdy_session_unittest.cc
diff --git a/net/spdy/chromium/spdy_session_unittest.cc b/net/spdy/chromium/spdy_session_unittest.cc
index d14187178359083d05129043012d0ae7d276fdcc..6b09f4349723142036ee3fdf97a84945a3ad0a04 100644
--- a/net/spdy/chromium/spdy_session_unittest.cc
+++ b/net/spdy/chromium/spdy_session_unittest.cc
@@ -5657,6 +5657,41 @@ TEST_F(AltSvcFrameTest, ProcessAltSvcFrame) {
EXPECT_EQ(alternative_service, altsvc_info_vector[0].alternative_service());
}
+// Regression test for https://crbug.com/736063.
+TEST_F(AltSvcFrameTest, IgnoreQuicAltSvcWithUnsupportedVersion) {
+ const char origin[] = "https://mail.example.org";
+ SpdyAltSvcIR altsvc_ir(/* stream_id = */ 0);
+ SpdyAltSvcWireFormat::AlternativeService quic_alternative_service(
+ "quic", "alternative.example.org", 443, 86400,
+ SpdyAltSvcWireFormat::VersionVector());
+ // TODO(zhongyi): SpdyAltSvcWireFormat::ParseHeaderFieldValue expects positve
+ // versions while VersionVector allows nonnegative verisons.
+ // Fix the parse function and change the hardcoded invalid version to
+ // QUIC_VERSION_UNSUPPORTED.
+ quic_alternative_service.version.push_back(/* invalid QUIC version */ 1);
+ altsvc_ir.add_altsvc(quic_alternative_service);
+ altsvc_ir.set_origin(origin);
+ AddSocketData(altsvc_ir);
+ AddSSLSocketData();
+
+ CreateNetworkSession();
+ CreateSecureSpdySession();
+
+ base::RunLoop().RunUntilIdle();
+
+ const url::SchemeHostPort session_origin("https", test_url_.host(),
+ test_url_.EffectiveIntPort());
+ AlternativeServiceInfoVector altsvc_info_vector =
+ spdy_session_pool_->http_server_properties()->GetAlternativeServiceInfos(
+ session_origin);
+ ASSERT_TRUE(altsvc_info_vector.empty());
+
+ altsvc_info_vector =
+ spdy_session_pool_->http_server_properties()->GetAlternativeServiceInfos(
+ url::SchemeHostPort(GURL(origin)));
+ ASSERT_EQ(0u, altsvc_info_vector.size());
+}
+
TEST_F(AltSvcFrameTest, DoNotProcessAltSvcFrameOnInsecureSession) {
const char origin[] = "https://mail.example.org";
SpdyAltSvcIR altsvc_ir(/* stream_id = */ 0);
« no previous file with comments | « net/spdy/chromium/spdy_session_pool.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698