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

Unified Diff: net/spdy/buffered_spdy_framer_unittest.cc

Issue 2718053003: Fix BufferedSpdyFrameTest.OnAltSvc. (Closed)
Patch Set: Remove; remove tests for functionality that has been removed in https://crrev.com/2723203002. 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/buffered_spdy_framer_unittest.cc
diff --git a/net/spdy/buffered_spdy_framer_unittest.cc b/net/spdy/buffered_spdy_framer_unittest.cc
index d5752c7aff8499c792bf69ed17e304acdbd39ecb..da2d5710d82a8aa4fec07d4b3d44b3fab2eeb698 100644
--- a/net/spdy/buffered_spdy_framer_unittest.cc
+++ b/net/spdy/buffered_spdy_framer_unittest.cc
@@ -284,14 +284,15 @@ TEST_F(BufferedSpdyFramerTest, GoAwayDebugData) {
EXPECT_EQ("foo", visitor.goaway_debug_data_);
}
-TEST_F(BufferedSpdyFramerTest, OnAltSvc) {
- const SpdyStreamId altsvc_stream_id(1);
- const char altsvc_origin[] = "https://www.example.org";
+// ALTSVC frame on stream 0 must have an origin.
+TEST_F(BufferedSpdyFramerTest, OnAltSvcOnStreamZero) {
+ const SpdyStreamId altsvc_stream_id(0);
SpdyAltSvcIR altsvc_ir(altsvc_stream_id);
SpdyAltSvcWireFormat::AlternativeService alternative_service(
"quic", "alternative.example.org", 443, 86400,
SpdyAltSvcWireFormat::VersionVector());
altsvc_ir.add_altsvc(alternative_service);
+ const char altsvc_origin[] = "https://www.example.org";
altsvc_ir.set_origin(altsvc_origin);
BufferedSpdyFramer framer;
SpdySerializedFrame altsvc_frame(framer.SerializeFrame(altsvc_ir));
@@ -306,4 +307,25 @@ TEST_F(BufferedSpdyFramerTest, OnAltSvc) {
EXPECT_EQ(alternative_service, visitor.altsvc_vector_[0]);
}
+// ALTSVC frame on a non-zero stream must not have an origin.
+TEST_F(BufferedSpdyFramerTest, OnAltSvcOnNonzeroStream) {
+ const SpdyStreamId altsvc_stream_id(1);
+ SpdyAltSvcIR altsvc_ir(altsvc_stream_id);
+ SpdyAltSvcWireFormat::AlternativeService alternative_service(
+ "quic", "alternative.example.org", 443, 86400,
+ SpdyAltSvcWireFormat::VersionVector());
+ altsvc_ir.add_altsvc(alternative_service);
+ BufferedSpdyFramer framer;
+ SpdySerializedFrame altsvc_frame(framer.SerializeFrame(altsvc_ir));
+
+ TestBufferedSpdyVisitor visitor;
+ visitor.SimulateInFramer(altsvc_frame);
+ EXPECT_EQ(0, visitor.error_count_);
+ EXPECT_EQ(1, visitor.altsvc_count_);
+ EXPECT_EQ(altsvc_stream_id, visitor.altsvc_stream_id_);
+ EXPECT_TRUE(visitor.altsvc_origin_.empty());
+ ASSERT_EQ(1u, visitor.altsvc_vector_.size());
+ EXPECT_EQ(alternative_service, visitor.altsvc_vector_[0]);
+}
+
} // namespace net
« 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