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

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

Issue 1906473004: Deprecate FLAGS_quic_consolidate_onstreamframe_errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@119645068
Patch Set: Rebase Created 4 years, 8 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
« no previous file with comments | « net/quic/quic_stream_sequencer.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_stream_sequencer.h" 5 #include "net/quic/quic_stream_sequencer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstdint> 8 #include <cstdint>
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 } 559 }
560 560
561 TEST_F(QuicStreamSequencerTest, DontAcceptOverlappingFrames) { 561 TEST_F(QuicStreamSequencerTest, DontAcceptOverlappingFrames) {
562 // The peer should never send us non-identical stream frames which contain 562 // The peer should never send us non-identical stream frames which contain
563 // overlapping byte ranges - if they do, we close the connection. 563 // overlapping byte ranges - if they do, we close the connection.
564 564
565 QuicStreamFrame frame1(kClientDataStreamId1, false, 1, StringPiece("hello")); 565 QuicStreamFrame frame1(kClientDataStreamId1, false, 1, StringPiece("hello"));
566 sequencer_->OnStreamFrame(frame1); 566 sequencer_->OnStreamFrame(frame1);
567 567
568 QuicStreamFrame frame2(kClientDataStreamId1, false, 2, StringPiece("hello")); 568 QuicStreamFrame frame2(kClientDataStreamId1, false, 2, StringPiece("hello"));
569 EXPECT_CALL(stream_, CloseConnectionWithDetails( 569 EXPECT_CALL(stream_,
570 FLAGS_quic_consolidate_onstreamframe_errors 570 CloseConnectionWithDetails(QUIC_OVERLAPPING_STREAM_DATA, _))
571 ? QUIC_OVERLAPPING_STREAM_DATA
572 : QUIC_EMPTY_STREAM_FRAME_NO_FIN,
573 _))
574 .Times(1); 571 .Times(1);
575 sequencer_->OnStreamFrame(frame2); 572 sequencer_->OnStreamFrame(frame2);
576 } 573 }
577 574
578 TEST_F(QuicStreamSequencerTest, InOrderTimestamps) { 575 TEST_F(QuicStreamSequencerTest, InOrderTimestamps) {
579 // This test verifies that timestamps returned by 576 // This test verifies that timestamps returned by
580 // GetReadableRegion() are in the correct sequence when frames 577 // GetReadableRegion() are in the correct sequence when frames
581 // arrive at the sequencer in order. 578 // arrive at the sequencer in order.
582 EXPECT_CALL(stream_, OnDataAvailable()); 579 EXPECT_CALL(stream_, OnDataAvailable());
583 580
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 EXPECT_EQ(timestamp, t1); 650 EXPECT_EQ(timestamp, t1);
654 QuicStreamSequencerTest::ConsumeData(3); 651 QuicStreamSequencerTest::ConsumeData(3);
655 EXPECT_EQ(0u, NumBufferedBytes()); 652 EXPECT_EQ(0u, NumBufferedBytes());
656 EXPECT_EQ(6u, sequencer_->NumBytesConsumed()); 653 EXPECT_EQ(6u, sequencer_->NumBytesConsumed());
657 EXPECT_EQ(0u, sequencer_->NumBytesBuffered()); 654 EXPECT_EQ(0u, sequencer_->NumBytesBuffered());
658 } 655 }
659 656
660 } // namespace 657 } // namespace
661 } // namespace test 658 } // namespace test
662 } // namespace net 659 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_sequencer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698