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

Side by Side Diff: net/quic/quic_headers_stream_test.cc

Issue 1576623002: relnote: quic_supports_push_promise should be disabled by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@9_CL_111542509
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« net/quic/quic_flags.cc ('K') | « net/quic/quic_flags.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_headers_stream.h" 5 #include "net/quic/quic_headers_stream.h"
6 6
7 #include "net/quic/quic_utils.h" 7 #include "net/quic/quic_utils.h"
8 #include "net/quic/spdy_utils.h" 8 #include "net/quic/spdy_utils.h"
9 #include "net/quic/test_tools/quic_connection_peer.h" 9 #include "net/quic/test_tools/quic_connection_peer.h"
10 #include "net/quic/test_tools/quic_spdy_session_peer.h" 10 #include "net/quic/test_tools/quic_spdy_session_peer.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 }; 108 };
109 109
110 // Constructs various test permutations. 110 // Constructs various test permutations.
111 vector<TestParams> GetTestParams() { 111 vector<TestParams> GetTestParams() {
112 vector<TestParams> params; 112 vector<TestParams> params;
113 QuicVersionVector all_supported_versions = QuicSupportedVersions(); 113 QuicVersionVector all_supported_versions = QuicSupportedVersions();
114 for (const QuicVersion version : all_supported_versions) { 114 for (const QuicVersion version : all_supported_versions) {
115 params.push_back(TestParams(version, Perspective::IS_CLIENT)); 115 params.push_back(TestParams(version, Perspective::IS_CLIENT));
116 params.push_back(TestParams(version, Perspective::IS_SERVER)); 116 params.push_back(TestParams(version, Perspective::IS_SERVER));
117 } 117 }
118 FLAGS_quic_supports_push_promise = true;
118 return params; 119 return params;
119 } 120 }
120 121
121 class QuicHeadersStreamTest : public ::testing::TestWithParam<TestParams> { 122 class QuicHeadersStreamTest : public ::testing::TestWithParam<TestParams> {
122 public: 123 public:
123 QuicHeadersStreamTest() 124 QuicHeadersStreamTest()
124 : connection_(new StrictMock<MockConnection>(&helper_, 125 : connection_(new StrictMock<MockConnection>(&helper_,
125 perspective(), 126 perspective(),
126 GetVersion())), 127 GetVersion())),
127 session_(connection_), 128 session_(connection_),
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 stream_frame_.frame_length = frame->size(); 333 stream_frame_.frame_length = frame->size();
333 headers_stream_->OnStreamFrame(stream_frame_); 334 headers_stream_->OnStreamFrame(stream_frame_);
334 stream_frame_.offset += frame->size(); 335 stream_frame_.offset += frame->size();
335 CheckHeaders(); 336 CheckHeaders();
336 } 337 }
337 } 338 }
338 } 339 }
339 } 340 }
340 341
341 TEST_P(QuicHeadersStreamTest, ProcessPushPromise) { 342 TEST_P(QuicHeadersStreamTest, ProcessPushPromise) {
342 FLAGS_quic_supports_push_promise = true; 343 if (perspective() == Perspective::IS_SERVER)
344 return;
343 for (QuicStreamId stream_id = kClientDataStreamId1; 345 for (QuicStreamId stream_id = kClientDataStreamId1;
344 stream_id < kClientDataStreamId3; stream_id += 2) { 346 stream_id < kClientDataStreamId3; stream_id += 2) {
345 QuicStreamId promised_stream_id = NextPromisedStreamId(); 347 QuicStreamId promised_stream_id = NextPromisedStreamId();
346 scoped_ptr<SpdySerializedFrame> frame; 348 scoped_ptr<SpdySerializedFrame> frame;
347 SpdyPushPromiseIR push_promise(stream_id, promised_stream_id); 349 SpdyPushPromiseIR push_promise(stream_id, promised_stream_id);
348 push_promise.set_header_block(headers_); 350 push_promise.set_header_block(headers_);
349 frame.reset(framer_.SerializeFrame(push_promise)); 351 frame.reset(framer_.SerializeFrame(push_promise));
350 if (perspective() == Perspective::IS_SERVER) { 352 if (perspective() == Perspective::IS_SERVER) {
351 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails( 353 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(
352 QUIC_INVALID_HEADERS_STREAM_DATA, 354 QUIC_INVALID_HEADERS_STREAM_DATA,
(...skipping 11 matching lines...) Expand all
364 stream_frame_.frame_length = frame->size(); 366 stream_frame_.frame_length = frame->size();
365 headers_stream_->OnStreamFrame(stream_frame_); 367 headers_stream_->OnStreamFrame(stream_frame_);
366 if (perspective() == Perspective::IS_CLIENT) { 368 if (perspective() == Perspective::IS_CLIENT) {
367 stream_frame_.offset += frame->size(); 369 stream_frame_.offset += frame->size();
368 CheckHeaders(); 370 CheckHeaders();
369 } 371 }
370 } 372 }
371 } 373 }
372 374
373 TEST_P(QuicHeadersStreamTest, PushPromiseOutOfOrder) { 375 TEST_P(QuicHeadersStreamTest, PushPromiseOutOfOrder) {
374 FLAGS_quic_supports_push_promise = true; 376 if (perspective() == Perspective::IS_SERVER)
375 if (perspective() == Perspective::IS_SERVER) {
376 return; 377 return;
377 }
378 378
379 QuicStreamId promised_stream_id = NextPromisedStreamId(); 379 QuicStreamId promised_stream_id = NextPromisedStreamId();
380 QuicStreamId stream_id = kClientDataStreamId1; 380 QuicStreamId stream_id = kClientDataStreamId1;
381 381
382 scoped_ptr<SpdySerializedFrame> frame; 382 scoped_ptr<SpdySerializedFrame> frame;
383 SpdyPushPromiseIR push_promise(stream_id, promised_stream_id); 383 SpdyPushPromiseIR push_promise(stream_id, promised_stream_id);
384 push_promise.set_header_block(headers_); 384 push_promise.set_header_block(headers_);
385 frame.reset(framer_.SerializeFrame(push_promise)); 385 frame.reset(framer_.SerializeFrame(push_promise));
386 EXPECT_CALL(session_, OnPromiseHeaders(stream_id, _)) 386 EXPECT_CALL(session_, OnPromiseHeaders(stream_id, _))
387 .WillRepeatedly(WithArgs<1>( 387 .WillRepeatedly(WithArgs<1>(
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 } 625 }
626 626
627 TEST_P(QuicHeadersStreamTest, NoConnectionLevelFlowControl) { 627 TEST_P(QuicHeadersStreamTest, NoConnectionLevelFlowControl) {
628 EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl( 628 EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl(
629 headers_stream_)); 629 headers_stream_));
630 } 630 }
631 631
632 } // namespace 632 } // namespace
633 } // namespace test 633 } // namespace test
634 } // namespace net 634 } // namespace net
OLDNEW
« net/quic/quic_flags.cc ('K') | « net/quic/quic_flags.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698