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 <algorithm> | 7 #include <algorithm> |
8 #include <cstdint> | 8 #include <cstdint> |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 MockStream(QuicSession* session, QuicStreamId id) | 45 MockStream(QuicSession* session, QuicStreamId id) |
46 : ReliableQuicStream(id, session) {} | 46 : ReliableQuicStream(id, session) {} |
47 | 47 |
48 MOCK_METHOD0(OnFinRead, void()); | 48 MOCK_METHOD0(OnFinRead, void()); |
49 MOCK_METHOD0(OnDataAvailable, void()); | 49 MOCK_METHOD0(OnDataAvailable, void()); |
50 MOCK_METHOD2(CloseConnectionWithDetails, | 50 MOCK_METHOD2(CloseConnectionWithDetails, |
51 void(QuicErrorCode error, const string& details)); | 51 void(QuicErrorCode error, const string& details)); |
52 MOCK_METHOD1(Reset, void(QuicRstStreamErrorCode error)); | 52 MOCK_METHOD1(Reset, void(QuicRstStreamErrorCode error)); |
53 MOCK_METHOD0(OnCanWrite, void()); | 53 MOCK_METHOD0(OnCanWrite, void()); |
54 virtual bool IsFlowControlEnabled() const { return true; } | 54 virtual bool IsFlowControlEnabled() const { return true; } |
| 55 |
| 56 const IPEndPoint& PeerAddressOfLatestPacket() const override { |
| 57 return peer_address_; |
| 58 } |
| 59 |
| 60 protected: |
| 61 IPEndPoint peer_address_ = IPEndPoint(net::test::Any4(), 65535); |
55 }; | 62 }; |
56 | 63 |
57 namespace { | 64 namespace { |
58 | 65 |
59 static const char kPayload[] = | 66 static const char kPayload[] = |
60 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; | 67 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; |
61 | 68 |
62 class QuicStreamSequencerTest : public ::testing::Test { | 69 class QuicStreamSequencerTest : public ::testing::Test { |
63 public: | 70 public: |
64 void ConsumeData(size_t num_bytes) { | 71 void ConsumeData(size_t num_bytes) { |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 EXPECT_EQ(timestamp, t1); | 660 EXPECT_EQ(timestamp, t1); |
654 QuicStreamSequencerTest::ConsumeData(3); | 661 QuicStreamSequencerTest::ConsumeData(3); |
655 EXPECT_EQ(0u, NumBufferedBytes()); | 662 EXPECT_EQ(0u, NumBufferedBytes()); |
656 EXPECT_EQ(6u, sequencer_->NumBytesConsumed()); | 663 EXPECT_EQ(6u, sequencer_->NumBytesConsumed()); |
657 EXPECT_EQ(0u, sequencer_->NumBytesBuffered()); | 664 EXPECT_EQ(0u, sequencer_->NumBytesBuffered()); |
658 } | 665 } |
659 | 666 |
660 } // namespace | 667 } // namespace |
661 } // namespace test | 668 } // namespace test |
662 } // namespace net | 669 } // namespace net |
OLD | NEW |