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

Unified Diff: net/spdy/spdy_stream_unittest.cc

Issue 2596703002: http2: Update priorities of pushed streams (Closed)
Patch Set: Created 4 years 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
Index: net/spdy/spdy_stream_unittest.cc
diff --git a/net/spdy/spdy_stream_unittest.cc b/net/spdy/spdy_stream_unittest.cc
index c41a975f2af8d3f853e9bed9f274bcd118a6df96..0e5309b762c2b17882c8c2e83ddc56c919dfaa37 100644
--- a/net/spdy/spdy_stream_unittest.cc
+++ b/net/spdy/spdy_stream_unittest.cc
@@ -293,6 +293,10 @@ TEST_F(SpdyStreamTest, PushedStream) {
spdy_util_.ConstructSpdyPush(nullptr, 0, 2, 1, kPushUrl));
AddRead(push);
+ SpdySerializedFrame priority(
+ spdy_util_.ConstructSpdyPriority(2, 1, IDLE, true));
+ AddWrite(priority);
+
AddReadPause();
base::StringPiece pushed_msg("foo");
@@ -339,9 +343,9 @@ TEST_F(SpdyStreamTest, PushedStream) {
data.RunUntilPaused();
base::WeakPtr<SpdyStream> push_stream;
- EXPECT_THAT(
- session->GetPushStream(GURL(kPushUrl), &push_stream, NetLogWithSource()),
- IsOk());
+ EXPECT_THAT(session->GetPushStream(GURL(kPushUrl), IDLE, &push_stream,
+ NetLogWithSource()),
+ IsOk());
ASSERT_TRUE(push_stream);
EXPECT_EQ(kPushUrl, push_stream->GetUrlFromHeaders().spec());
@@ -609,6 +613,10 @@ TEST_F(SpdyStreamTest, UpperCaseHeadersOnPush) {
kExtraHeaders, arraysize(kExtraHeaders) / 2, 2, 1, kPushUrl));
AddRead(push);
+ SpdySerializedFrame priority(
+ spdy_util_.ConstructSpdyPriority(2, 1, IDLE, true));
+ AddWrite(priority);
+
SpdySerializedFrame rst(
spdy_util_.ConstructSpdyRstStream(2, RST_STREAM_PROTOCOL_ERROR));
AddWrite(rst);
@@ -645,9 +653,9 @@ TEST_F(SpdyStreamTest, UpperCaseHeadersOnPush) {
data.RunUntilPaused();
base::WeakPtr<SpdyStream> push_stream;
- EXPECT_THAT(
- session->GetPushStream(GURL(kPushUrl), &push_stream, NetLogWithSource()),
- IsOk());
+ EXPECT_THAT(session->GetPushStream(GURL(kPushUrl), IDLE, &push_stream,
+ NetLogWithSource()),
+ IsOk());
EXPECT_FALSE(push_stream);
data.Resume();
@@ -721,6 +729,10 @@ TEST_F(SpdyStreamTest, HeadersMustHaveStatusOnPushedStream) {
spdy_util_.ConstructGetHeaderBlock(kPushUrl), 2, 1));
AddRead(push_promise);
+ SpdySerializedFrame priority(
+ spdy_util_.ConstructSpdyPriority(2, 1, IDLE, true));
+ AddWrite(priority);
+
// Response headers without ":status" header field: protocol error.
SpdyHeaderBlock header_block_without_status;
header_block_without_status[spdy_util_.GetMethodKey()] = "GET";
@@ -830,6 +842,10 @@ TEST_F(SpdyStreamTest, HeadersMustPreceedDataOnPushedStream) {
spdy_util_.ConstructGetHeaderBlock(kPushUrl), 2, 1));
AddRead(push_promise);
+ SpdySerializedFrame priority(
+ spdy_util_.ConstructSpdyPriority(2, 1, IDLE, true));
+ AddWrite(priority);
+
SpdySerializedFrame pushed_body(
spdy_util_.ConstructSpdyDataFrame(2, kPostBody, kPostBodyLength, true));
AddRead(pushed_body);

Powered by Google App Engine
This is Rietveld 408576698