| 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/core/quic_unacked_packet_map.h" | 5 #include "net/quic/core/quic_unacked_packet_map.h" |
| 6 | 6 |
| 7 #include "net/quic/platform/api/quic_test.h" |
| 7 #include "net/quic/test_tools/quic_test_utils.h" | 8 #include "net/quic/test_tools/quic_test_utils.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| 11 namespace test { | 11 namespace test { |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 // Default packet length. | 14 // Default packet length. |
| 15 const uint32_t kDefaultLength = 1000; | 15 const uint32_t kDefaultLength = 1000; |
| 16 | 16 |
| 17 class QuicUnackedPacketMapTest : public ::testing::Test { | 17 class QuicUnackedPacketMapTest : public QuicTest { |
| 18 protected: | 18 protected: |
| 19 QuicUnackedPacketMapTest() | 19 QuicUnackedPacketMapTest() |
| 20 : unacked_packets_(), | 20 : unacked_packets_(), |
| 21 now_(QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(1000)) {} | 21 now_(QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(1000)) {} |
| 22 | 22 |
| 23 ~QuicUnackedPacketMapTest() override {} | 23 ~QuicUnackedPacketMapTest() override {} |
| 24 | 24 |
| 25 SerializedPacket CreateRetransmittablePacket(QuicPacketNumber packet_number) { | 25 SerializedPacket CreateRetransmittablePacket(QuicPacketNumber packet_number) { |
| 26 return CreateRetransmittablePacketForStream(packet_number, | 26 return CreateRetransmittablePacketForStream(packet_number, |
| 27 kHeadersStreamId); | 27 kHeadersStreamId); |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 EXPECT_FALSE(unacked_packets_.IsUnacked(2)); | 377 EXPECT_FALSE(unacked_packets_.IsUnacked(2)); |
| 378 EXPECT_TRUE(unacked_packets_.IsUnacked(3)); | 378 EXPECT_TRUE(unacked_packets_.IsUnacked(3)); |
| 379 EXPECT_FALSE(unacked_packets_.IsUnacked(4)); | 379 EXPECT_FALSE(unacked_packets_.IsUnacked(4)); |
| 380 EXPECT_TRUE(unacked_packets_.IsUnacked(5)); | 380 EXPECT_TRUE(unacked_packets_.IsUnacked(5)); |
| 381 EXPECT_EQ(5u, unacked_packets_.largest_sent_packet()); | 381 EXPECT_EQ(5u, unacked_packets_.largest_sent_packet()); |
| 382 } | 382 } |
| 383 | 383 |
| 384 } // namespace | 384 } // namespace |
| 385 } // namespace test | 385 } // namespace test |
| 386 } // namespace net | 386 } // namespace net |
| OLD | NEW |