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

Unified Diff: net/quic/core/quic_headers_stream_test.cc

Issue 2534313002: Rewriting the headers stream test to not use SYN_STREAM/SYN_REPLY (Closed)
Patch Set: Created 4 years, 1 month 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/quic/core/quic_headers_stream_test.cc
diff --git a/net/quic/core/quic_headers_stream_test.cc b/net/quic/core/quic_headers_stream_test.cc
index d1f728a659077a35d78ba00eeb1184cba90f7974..1acf3028343f2b67432fd1b0a1ead8d9f4c383dc 100644
--- a/net/quic/core/quic_headers_stream_test.cc
+++ b/net/quic/core/quic_headers_stream_test.cc
@@ -314,20 +314,20 @@ class QuicHeadersStreamTest : public ::testing::TestWithParam<TestParamsTuple> {
headers_handler_->OnHeaderBlockEnd(size);
}
- void WriteHeadersAndExpectSynStream(QuicStreamId stream_id,
- bool fin,
- SpdyPriority priority) {
- WriteHeadersAndCheckData(stream_id, fin, priority, SYN_STREAM);
+ void WriteAndExpectRequestHeaders(QuicStreamId stream_id,
+ bool fin,
+ SpdyPriority priority) {
+ WriteHeadersAndCheckData(stream_id, fin, priority, true /*is_request*/);
}
- void WriteHeadersAndExpectSynReply(QuicStreamId stream_id, bool fin) {
- WriteHeadersAndCheckData(stream_id, fin, 0, SYN_REPLY);
+ void WriteAndExpectResponseHeaders(QuicStreamId stream_id, bool fin) {
+ WriteHeadersAndCheckData(stream_id, fin, 0, false /*is_request*/);
}
void WriteHeadersAndCheckData(QuicStreamId stream_id,
bool fin,
SpdyPriority priority,
- SpdyFrameType type) {
+ bool is_request) {
// Write the headers and capture the outgoing data
EXPECT_CALL(session_, WritevData(headers_stream_, kHeadersStreamId, _, _,
false, nullptr))
@@ -336,7 +336,7 @@ class QuicHeadersStreamTest : public ::testing::TestWithParam<TestParamsTuple> {
nullptr);
// Parse the outgoing data and check that it matches was was written.
- if (type == SYN_STREAM) {
+ if (is_request) {
EXPECT_CALL(visitor_,
OnHeaders(stream_id, kHasPriority,
Spdy3PriorityToHttp2Weight(priority),
@@ -431,11 +431,11 @@ TEST_P(QuicHeadersStreamTest, WriteHeaders) {
stream_id < kClientDataStreamId3; stream_id += 2) {
for (bool fin : kFins) {
if (perspective() == Perspective::IS_SERVER) {
- WriteHeadersAndExpectSynReply(stream_id, fin);
+ WriteAndExpectResponseHeaders(stream_id, fin);
} else {
for (SpdyPriority priority = 0; priority < 7; ++priority) {
// TODO(rch): implement priorities correctly.
- WriteHeadersAndExpectSynStream(stream_id, fin, 0);
+ WriteAndExpectRequestHeaders(stream_id, fin, 0);
}
}
}
@@ -932,12 +932,12 @@ TEST_P(QuicHeadersStreamTest, HpackEncoderDebugVisitor) {
stream_id < kClientDataStreamId3; stream_id += 2) {
for (bool fin : {false, true}) {
if (perspective() == Perspective::IS_SERVER) {
- WriteHeadersAndExpectSynReply(stream_id, fin);
+ WriteAndExpectResponseHeaders(stream_id, fin);
connection_->AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
} else {
for (SpdyPriority priority = 0; priority < 7; ++priority) {
// TODO(rch): implement priorities correctly.
- WriteHeadersAndExpectSynStream(stream_id, fin, 0);
+ WriteAndExpectRequestHeaders(stream_id, fin, 0);
connection_->AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
}
}
« 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