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

Unified Diff: net/spdy/spdy_session_unittest.cc

Issue 2724703002: Add AltSvcFrameTest for non-empty origin on non-zero frame. (Closed)
Patch Set: Add comment; rename one existing test. Created 3 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session_unittest.cc
diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc
index e98358fb59e9d79c6f4491d823ba3cd45c0cfe29..f0ab24a79ea2cbc7057f11a73599e7b9ff3f1a6c 100644
--- a/net/spdy/spdy_session_unittest.cc
+++ b/net/spdy/spdy_session_unittest.cc
@@ -5625,7 +5625,9 @@ TEST_F(AltSvcFrameTest, DoNotProcessAltSvcFrameForOriginNotCoveredByCert) {
ASSERT_TRUE(altsvc_vector.empty());
}
-TEST_F(AltSvcFrameTest, DoNotProcessAltSvcFrameWithEmptyOriginOnZeroStream) {
+// An ALTSVC frame on stream 0 with empty origin MUST be ignored.
+// (RFC 7838 Section 4)
+TEST_F(AltSvcFrameTest, DoNotProcessAltSvcFrameWithEmptyOriginOnStreamZero) {
SpdyAltSvcIR altsvc_ir(0);
altsvc_ir.add_altsvc(alternative_service_);
AddSocketData(altsvc_ir);
@@ -5644,6 +5646,29 @@ TEST_F(AltSvcFrameTest, DoNotProcessAltSvcFrameWithEmptyOriginOnZeroStream) {
ASSERT_TRUE(altsvc_vector.empty());
}
+// An ALTSVC frame on a stream other than stream 0 with non-empty origin MUST be
+// ignored. (RFC 7838 Section 4)
+TEST_F(AltSvcFrameTest,
+ DoNotProcessAltSvcFrameWithNonEmptyOriginOnNonZeroStream) {
+ SpdyAltSvcIR altsvc_ir(1);
+ altsvc_ir.add_altsvc(alternative_service_);
+ altsvc_ir.set_origin("https://mail.example.org");
+ AddSocketData(altsvc_ir);
+ AddSSLSocketData();
+
+ CreateNetworkSession();
+ CreateSecureSpdySession();
+
+ base::RunLoop().RunUntilIdle();
+
+ const url::SchemeHostPort session_origin("https", test_url_.host(),
+ test_url_.EffectiveIntPort());
+ AlternativeServiceVector altsvc_vector =
+ spdy_session_pool_->http_server_properties()->GetAlternativeServices(
+ session_origin);
+ ASSERT_TRUE(altsvc_vector.empty());
+}
+
TEST_F(AltSvcFrameTest, ProcessAltSvcFrameOnActiveStream) {
SpdyAltSvcIR altsvc_ir(1);
altsvc_ir.add_altsvc(alternative_service_);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698