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

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

Issue 2350173005: QUIC enable server push by default. Guarded by FLAGS_quic_enable_server_push_by_default. (Closed)
Patch Set: Created 4 years, 3 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/quic/core/quic_headers_stream.cc ('k') | net/quic/core/quic_server_session_base.h » ('j') | 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 800cf48a1e5c9ee8e2e69edec608ed0161fc6237..c1ca9fbb00fbf39c50a239a1af7979fc9ca7db82 100644
--- a/net/quic/core/quic_headers_stream_test.cc
+++ b/net/quic/core/quic_headers_stream_test.cc
@@ -530,6 +530,28 @@ TEST_P(QuicHeadersStreamTest, ProcessPushPromise) {
}
}
+TEST_P(QuicHeadersStreamTest, ProcessPushPromiseDisabledSetting) {
+ FLAGS_quic_respect_http2_settings_frame = true;
+ FLAGS_quic_enable_server_push_by_default = true;
+ session_.OnConfigNegotiated();
+ SpdySettingsIR data;
+ // Respect supported settings frames SETTINGS_ENABLE_PUSH.
+ data.AddSetting(SETTINGS_ENABLE_PUSH, true, true, 0);
+ SpdySerializedFrame frame(framer_->SerializeFrame(data));
+ stream_frame_.data_buffer = frame.data();
+ stream_frame_.data_length = frame.size();
+ if (perspective() == Perspective::IS_CLIENT) {
+ EXPECT_CALL(
+ *connection_,
+ CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA,
+ "Unsupported field of HTTP/2 SETTINGS frame: 9", _));
+ }
+ headers_stream_->OnStreamFrame(stream_frame_);
+ EXPECT_EQ(
+ session_.server_push_enabled(),
+ (perspective() == Perspective::IS_CLIENT && version() > QUIC_VERSION_34));
+}
+
TEST_P(QuicHeadersStreamTest, EmptyHeaderHOLBlockedTime) {
EXPECT_CALL(session_, OnHeadersHeadOfLineBlocking(_)).Times(0);
testing::InSequence seq;
@@ -764,11 +786,14 @@ TEST_P(QuicHeadersStreamTest, RespectHttp2SettingsFrameUnsupportedFields) {
"Unsupported field of HTTP/2 SETTINGS frame: " +
base::IntToString(SETTINGS_INITIAL_WINDOW_SIZE),
_));
- EXPECT_CALL(*connection_,
- CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA,
- "Unsupported field of HTTP/2 SETTINGS frame: " +
- base::IntToString(SETTINGS_ENABLE_PUSH),
- _));
+ if (!FLAGS_quic_enable_server_push_by_default ||
+ session_.perspective() == Perspective::IS_CLIENT) {
+ EXPECT_CALL(*connection_,
+ CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA,
+ "Unsupported field of HTTP/2 SETTINGS frame: " +
+ base::IntToString(SETTINGS_ENABLE_PUSH),
+ _));
+ }
EXPECT_CALL(*connection_,
CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA,
"Unsupported field of HTTP/2 SETTINGS frame: " +
« no previous file with comments | « net/quic/core/quic_headers_stream.cc ('k') | net/quic/core/quic_server_session_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698