| OLD | NEW |
| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 231 |
| 232 TEST_F(QuicStreamSequencerTest, EmptyFrame) { | 232 TEST_F(QuicStreamSequencerTest, EmptyFrame) { |
| 233 EXPECT_CALL(stream_, | 233 EXPECT_CALL(stream_, |
| 234 CloseConnectionWithDetails(QUIC_INVALID_STREAM_FRAME, _)); | 234 CloseConnectionWithDetails(QUIC_INVALID_STREAM_FRAME, _)); |
| 235 OnFrame(0, ""); | 235 OnFrame(0, ""); |
| 236 EXPECT_EQ(0u, NumBufferedFrames()); | 236 EXPECT_EQ(0u, NumBufferedFrames()); |
| 237 EXPECT_EQ(0u, sequencer_->num_bytes_consumed()); | 237 EXPECT_EQ(0u, sequencer_->num_bytes_consumed()); |
| 238 } | 238 } |
| 239 | 239 |
| 240 TEST_F(QuicStreamSequencerTest, EmptyFinFrame) { | 240 TEST_F(QuicStreamSequencerTest, EmptyFinFrame) { |
| 241 EXPECT_CALL(stream_, OnFinRead()); | 241 EXPECT_CALL(stream_, OnDataAvailable()); |
| 242 OnFinFrame(0, ""); | 242 OnFinFrame(0, ""); |
| 243 EXPECT_EQ(0u, NumBufferedFrames()); | 243 EXPECT_EQ(0u, NumBufferedFrames()); |
| 244 EXPECT_EQ(0u, sequencer_->num_bytes_consumed()); | 244 EXPECT_EQ(0u, sequencer_->num_bytes_consumed()); |
| 245 } | 245 } |
| 246 | 246 |
| 247 TEST_F(QuicStreamSequencerTest, PartialFrameConsumed) { | 247 TEST_F(QuicStreamSequencerTest, PartialFrameConsumed) { |
| 248 EXPECT_CALL(stream_, OnDataAvailable()) | 248 EXPECT_CALL(stream_, OnDataAvailable()) |
| 249 .WillOnce(testing::Invoke( | 249 .WillOnce(testing::Invoke( |
| 250 CreateFunctor(this, &QuicStreamSequencerTest::ConsumeData, 2))); | 250 CreateFunctor(this, &QuicStreamSequencerTest::ConsumeData, 2))); |
| 251 | 251 |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |