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/rand_util.h" | 10 #include "base/rand_util.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 namespace { | 81 namespace { |
82 | 82 |
83 static const char kPayload[] = | 83 static const char kPayload[] = |
84 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; | 84 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; |
85 | 85 |
86 class QuicStreamSequencerTest : public ::testing::Test { | 86 class QuicStreamSequencerTest : public ::testing::Test { |
87 protected: | 87 protected: |
88 QuicStreamSequencerTest() | 88 QuicStreamSequencerTest() |
89 : connection_(new MockConnection(false)), | 89 : connection_(new MockConnection(false)), |
90 session_(connection_, true), | 90 session_(connection_), |
91 stream_(&session_, 1), | 91 stream_(&session_, 1), |
92 sequencer_(new QuicStreamSequencerPeer(&stream_)) { | 92 sequencer_(new QuicStreamSequencerPeer(&stream_)) { |
93 } | 93 } |
94 | 94 |
95 bool VerifyReadableRegions(const char** expected, size_t num_expected) { | 95 bool VerifyReadableRegions(const char** expected, size_t num_expected) { |
96 iovec iovecs[5]; | 96 iovec iovecs[5]; |
97 size_t num_iovecs = sequencer_->GetReadableRegions(iovecs, | 97 size_t num_iovecs = sequencer_->GetReadableRegions(iovecs, |
98 arraysize(iovecs)); | 98 arraysize(iovecs)); |
99 return VerifyIovecs(iovecs, num_iovecs, expected, num_expected); | 99 return VerifyIovecs(iovecs, num_iovecs, expected, num_expected); |
100 } | 100 } |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 | 572 |
573 if (acked) { | 573 if (acked) { |
574 list_.erase(list_.begin() + index); | 574 list_.erase(list_.begin() + index); |
575 } | 575 } |
576 } | 576 } |
577 } | 577 } |
578 | 578 |
579 } // namespace | 579 } // namespace |
580 } // namespace test | 580 } // namespace test |
581 } // namespace net | 581 } // namespace net |
OLD | NEW |