| 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 "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "net/quic/quic_flags.h" | 8 #include "net/quic/quic_flags.h" |
| 9 #include "net/quic/quic_utils.h" | 9 #include "net/quic/quic_utils.h" |
| 10 #include "net/quic/test_tools/quic_test_utils.h" | 10 #include "net/quic/test_tools/quic_test_utils.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 using std::min; | 13 using std::min; |
| 14 using std::vector; | 14 using std::vector; |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 namespace test { | 17 namespace test { |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 // Default packet length. | 20 // Default packet length. |
| 21 const uint32 kDefaultAckLength = 50; | 21 const uint32_t kDefaultAckLength = 50; |
| 22 const uint32 kDefaultLength = 1000; | 22 const uint32_t kDefaultLength = 1000; |
| 23 | 23 |
| 24 class QuicUnackedPacketMapTest : public ::testing::Test { | 24 class QuicUnackedPacketMapTest : public ::testing::Test { |
| 25 protected: | 25 protected: |
| 26 QuicUnackedPacketMapTest() | 26 QuicUnackedPacketMapTest() |
| 27 : unacked_packets_(), | 27 : unacked_packets_(), |
| 28 now_(QuicTime::Zero().Add(QuicTime::Delta::FromMilliseconds(1000))) {} | 28 now_(QuicTime::Zero().Add(QuicTime::Delta::FromMilliseconds(1000))) {} |
| 29 | 29 |
| 30 ~QuicUnackedPacketMapTest() override { STLDeleteElements(&packets_); } | 30 ~QuicUnackedPacketMapTest() override { STLDeleteElements(&packets_); } |
| 31 | 31 |
| 32 SerializedPacket CreateRetransmittablePacket(QuicPacketNumber packet_number) { | 32 SerializedPacket CreateRetransmittablePacket(QuicPacketNumber packet_number) { |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 EXPECT_FALSE(unacked_packets_.IsUnacked(2)); | 413 EXPECT_FALSE(unacked_packets_.IsUnacked(2)); |
| 414 EXPECT_TRUE(unacked_packets_.IsUnacked(3)); | 414 EXPECT_TRUE(unacked_packets_.IsUnacked(3)); |
| 415 EXPECT_FALSE(unacked_packets_.IsUnacked(4)); | 415 EXPECT_FALSE(unacked_packets_.IsUnacked(4)); |
| 416 EXPECT_TRUE(unacked_packets_.IsUnacked(5)); | 416 EXPECT_TRUE(unacked_packets_.IsUnacked(5)); |
| 417 EXPECT_EQ(5u, unacked_packets_.largest_sent_packet()); | 417 EXPECT_EQ(5u, unacked_packets_.largest_sent_packet()); |
| 418 } | 418 } |
| 419 | 419 |
| 420 } // namespace | 420 } // namespace |
| 421 } // namespace test | 421 } // namespace test |
| 422 } // namespace net | 422 } // namespace net |
| OLD | NEW |