OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_unacked_packet_map.h" | 5 #include "net/quic/quic_unacked_packet_map.h" |
6 | 6 |
7 #include "net/quic/test_tools/quic_test_utils.h" | 7 #include "net/quic/test_tools/quic_test_utils.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 using std::min; | 10 using std::min; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 VerifyInFlightPackets(unacked, arraysize(unacked)); | 178 VerifyInFlightPackets(unacked, arraysize(unacked)); |
179 VerifyRetransmittablePackets(nullptr, 0); | 179 VerifyRetransmittablePackets(nullptr, 0); |
180 | 180 |
181 unacked_packets_.IncreaseLargestObserved(2); | 181 unacked_packets_.IncreaseLargestObserved(2); |
182 VerifyUnackedPackets(unacked, arraysize(unacked)); | 182 VerifyUnackedPackets(unacked, arraysize(unacked)); |
183 VerifyInFlightPackets(unacked, arraysize(unacked)); | 183 VerifyInFlightPackets(unacked, arraysize(unacked)); |
184 VerifyRetransmittablePackets(nullptr, 0); | 184 VerifyRetransmittablePackets(nullptr, 0); |
185 | 185 |
186 unacked_packets_.RemoveFromInFlight(2); | 186 unacked_packets_.RemoveFromInFlight(2); |
187 QuicPacketSequenceNumber unacked2[] = { 1 }; | 187 QuicPacketSequenceNumber unacked2[] = { 1 }; |
188 VerifyUnackedPackets(unacked, arraysize(unacked2)); | 188 VerifyUnackedPackets(unacked2, arraysize(unacked2)); |
189 VerifyInFlightPackets(unacked, arraysize(unacked2)); | 189 VerifyInFlightPackets(unacked2, arraysize(unacked2)); |
190 VerifyRetransmittablePackets(nullptr, 0); | 190 VerifyRetransmittablePackets(nullptr, 0); |
191 | 191 |
192 unacked_packets_.RemoveFromInFlight(1); | 192 unacked_packets_.RemoveFromInFlight(1); |
193 VerifyUnackedPackets(nullptr, 0); | 193 VerifyUnackedPackets(nullptr, 0); |
194 VerifyInFlightPackets(nullptr, 0); | 194 VerifyInFlightPackets(nullptr, 0); |
195 VerifyRetransmittablePackets(nullptr, 0); | 195 VerifyRetransmittablePackets(nullptr, 0); |
196 } | 196 } |
197 | 197 |
198 TEST_F(QuicUnackedPacketMapTest, RetransmitThreeTimes) { | 198 TEST_F(QuicUnackedPacketMapTest, RetransmitThreeTimes) { |
199 // Simulate a retransmittable packet being sent and retransmitted twice. | 199 // Simulate a retransmittable packet being sent and retransmitted twice. |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 EXPECT_TRUE(unacked_packets_.IsUnacked(3)); | 385 EXPECT_TRUE(unacked_packets_.IsUnacked(3)); |
386 EXPECT_FALSE(unacked_packets_.IsUnacked(4)); | 386 EXPECT_FALSE(unacked_packets_.IsUnacked(4)); |
387 EXPECT_TRUE(unacked_packets_.IsUnacked(5)); | 387 EXPECT_TRUE(unacked_packets_.IsUnacked(5)); |
388 EXPECT_EQ(5u, unacked_packets_.largest_sent_packet()); | 388 EXPECT_EQ(5u, unacked_packets_.largest_sent_packet()); |
389 } | 389 } |
390 | 390 |
391 | 391 |
392 } // namespace | 392 } // namespace |
393 } // namespace test | 393 } // namespace test |
394 } // namespace net | 394 } // namespace net |
OLD | NEW |