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

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

Issue 1400293002: relnote: refactoring the buffering logic in QUIC's stream sequencer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disentangle merge of 104894802 Created 5 years, 2 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') | net/quic/test_tools/quic_stream_sequencer_peer.cc » ('j') | 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 <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 516
517 // Peek into the data. Only the first chunk should be readable because of the 517 // Peek into the data. Only the first chunk should be readable because of the
518 // missing data. 518 // missing data.
519 const char* expected[] = {"abc"}; 519 const char* expected[] = {"abc"};
520 ASSERT_TRUE(VerifyReadableRegions(expected, arraysize(expected))); 520 ASSERT_TRUE(VerifyReadableRegions(expected, arraysize(expected)));
521 521
522 // Now, attempt to mark consumed more data than was readable and expect the 522 // Now, attempt to mark consumed more data than was readable and expect the
523 // stream to be closed. 523 // stream to be closed.
524 EXPECT_CALL(stream_, Reset(QUIC_ERROR_PROCESSING_STREAM)); 524 EXPECT_CALL(stream_, Reset(QUIC_ERROR_PROCESSING_STREAM));
525 EXPECT_DFATAL(sequencer_->MarkConsumed(4), 525 EXPECT_DFATAL(sequencer_->MarkConsumed(4),
526 "Invalid argument to MarkConsumed. num_bytes_consumed_: 3 " 526 "Invalid argument to MarkConsumed."
527 "end_offset: 4 offset: 9 length: 17"); 527 " expect to consume: 4, but not enough bytes available.");
528 } 528 }
529 529
530 TEST_F(QuicStreamSequencerTest, MarkConsumedWithMissingPacket) { 530 TEST_F(QuicStreamSequencerTest, MarkConsumedWithMissingPacket) {
531 InSequence s; 531 InSequence s;
532 EXPECT_CALL(stream_, OnDataAvailable()); 532 EXPECT_CALL(stream_, OnDataAvailable());
533 533
534 OnFrame(0, "abc"); 534 OnFrame(0, "abc");
535 OnFrame(3, "def"); 535 OnFrame(3, "def");
536 // Missing packet: 6, ghi. 536 // Missing packet: 6, ghi.
537 OnFrame(9, "jkl"); 537 OnFrame(9, "jkl");
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 QuicStreamFrame frame2(kClientDataStreamId1, false, 2, StringPiece("hello")); 591 QuicStreamFrame frame2(kClientDataStreamId1, false, 2, StringPiece("hello"));
592 EXPECT_TRUE(FrameOverlapsBufferedData(frame2)); 592 EXPECT_TRUE(FrameOverlapsBufferedData(frame2));
593 EXPECT_CALL(stream_, CloseConnectionWithDetails(QUIC_INVALID_STREAM_FRAME, _)) 593 EXPECT_CALL(stream_, CloseConnectionWithDetails(QUIC_INVALID_STREAM_FRAME, _))
594 .Times(1); 594 .Times(1);
595 sequencer_->OnStreamFrame(frame2); 595 sequencer_->OnStreamFrame(frame2);
596 } 596 }
597 597
598 } // namespace 598 } // namespace
599 } // namespace test 599 } // namespace test
600 } // namespace net 600 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_sequencer.cc ('k') | net/quic/test_tools/quic_stream_sequencer_peer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698