| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 frame.offset = byte_offset; | 140 frame.offset = byte_offset; |
| 141 frame.data = StringPiece(data); | 141 frame.data = StringPiece(data); |
| 142 frame.fin = false; | 142 frame.fin = false; |
| 143 sequencer_->OnStreamFrame(frame); | 143 sequencer_->OnStreamFrame(frame); |
| 144 } | 144 } |
| 145 | 145 |
| 146 size_t NumBufferedBytes() { | 146 size_t NumBufferedBytes() { |
| 147 return QuicStreamSequencerPeer::GetNumBufferedBytes(sequencer_.get()); | 147 return QuicStreamSequencerPeer::GetNumBufferedBytes(sequencer_.get()); |
| 148 } | 148 } |
| 149 | 149 |
| 150 MockHelper helper_; | 150 MockConnectionHelper helper_; |
| 151 MockConnection* connection_; | 151 MockConnection* connection_; |
| 152 MockClock clock_; | 152 MockClock clock_; |
| 153 MockQuicSpdySession session_; | 153 MockQuicSpdySession session_; |
| 154 testing::StrictMock<MockStream> stream_; | 154 testing::StrictMock<MockStream> stream_; |
| 155 scoped_ptr<QuicStreamSequencer> sequencer_; | 155 scoped_ptr<QuicStreamSequencer> sequencer_; |
| 156 }; | 156 }; |
| 157 | 157 |
| 158 // TODO(rch): reorder these tests so they build on each other. | 158 // TODO(rch): reorder these tests so they build on each other. |
| 159 | 159 |
| 160 TEST_F(QuicStreamSequencerTest, RejectOldFrame) { | 160 TEST_F(QuicStreamSequencerTest, RejectOldFrame) { |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 EXPECT_EQ(timestamp, t1); | 688 EXPECT_EQ(timestamp, t1); |
| 689 QuicStreamSequencerTest::ConsumeData(3); | 689 QuicStreamSequencerTest::ConsumeData(3); |
| 690 EXPECT_EQ(0u, NumBufferedBytes()); | 690 EXPECT_EQ(0u, NumBufferedBytes()); |
| 691 EXPECT_EQ(6u, sequencer_->NumBytesConsumed()); | 691 EXPECT_EQ(6u, sequencer_->NumBytesConsumed()); |
| 692 EXPECT_EQ(0u, sequencer_->NumBytesBuffered()); | 692 EXPECT_EQ(0u, sequencer_->NumBytesBuffered()); |
| 693 } | 693 } |
| 694 | 694 |
| 695 } // namespace | 695 } // namespace |
| 696 } // namespace test | 696 } // namespace test |
| 697 } // namespace net | 697 } // namespace net |
| OLD | NEW |