OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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_multipath_received_packet_manager.h" | 5 #include "net/quic/quic_multipath_received_packet_manager.h" |
6 | 6 |
7 #include "net/quic/quic_connection_stats.h" | 7 #include "net/quic/quic_connection_stats.h" |
| 8 #include "net/quic/quic_flags.h" |
8 #include "net/quic/test_tools/quic_test_utils.h" | 9 #include "net/quic/test_tools/quic_test_utils.h" |
9 #include "net/test/gtest_util.h" | 10 #include "net/test/gtest_util.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
12 | 13 |
13 using testing::Return; | 14 using testing::Return; |
14 using testing::_; | 15 using testing::_; |
15 | 16 |
16 namespace net { | 17 namespace net { |
17 namespace test { | 18 namespace test { |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 EXPECT_TRUE(multipath_manager_.IsAwaitingPacket(kDefaultPathId, | 121 EXPECT_TRUE(multipath_manager_.IsAwaitingPacket(kDefaultPathId, |
121 header_.packet_number)); | 122 header_.packet_number)); |
122 EXPECT_FALSE( | 123 EXPECT_FALSE( |
123 multipath_manager_.IsAwaitingPacket(kPathId1, header_.packet_number)); | 124 multipath_manager_.IsAwaitingPacket(kPathId1, header_.packet_number)); |
124 EXPECT_DFATAL( | 125 EXPECT_DFATAL( |
125 multipath_manager_.IsAwaitingPacket(kPathId2, header_.packet_number), | 126 multipath_manager_.IsAwaitingPacket(kPathId2, header_.packet_number), |
126 "Check whether a packet is awaited on a non-existent path"); | 127 "Check whether a packet is awaited on a non-existent path"); |
127 } | 128 } |
128 | 129 |
129 TEST_F(QuicMultipathReceivedPacketManagerTest, UpdateReceivedPacketInfo) { | 130 TEST_F(QuicMultipathReceivedPacketManagerTest, UpdateReceivedPacketInfo) { |
| 131 FLAGS_quic_dont_copy_acks = false; |
130 std::vector<QuicAckFrame> ack_frames; | 132 std::vector<QuicAckFrame> ack_frames; |
131 EXPECT_EQ(static_cast<size_t>(0), ack_frames.size()); | 133 EXPECT_EQ(static_cast<size_t>(0), ack_frames.size()); |
132 EXPECT_CALL(*manager_0_, ack_frame_updated()).WillOnce(Return(false)); | 134 EXPECT_CALL(*manager_0_, ack_frame_updated()).WillOnce(Return(false)); |
133 EXPECT_CALL(*manager_1_, ack_frame_updated()).WillRepeatedly(Return(false)); | 135 EXPECT_CALL(*manager_1_, ack_frame_updated()).WillRepeatedly(Return(false)); |
134 multipath_manager_.UpdateReceivedPacketInfo(&ack_frames, QuicTime::Zero(), | 136 multipath_manager_.UpdateReceivedPacketInfo(&ack_frames, QuicTime::Zero(), |
135 /*force_all_paths=*/false); | 137 /*force_all_paths=*/false); |
136 EXPECT_EQ(static_cast<size_t>(0), ack_frames.size()); | 138 EXPECT_EQ(static_cast<size_t>(0), ack_frames.size()); |
137 EXPECT_CALL(*manager_0_, ack_frame_updated()).WillOnce(Return(true)); | 139 EXPECT_CALL(*manager_0_, ack_frame_updated()).WillOnce(Return(true)); |
138 multipath_manager_.UpdateReceivedPacketInfo(&ack_frames, QuicTime::Zero(), | 140 multipath_manager_.UpdateReceivedPacketInfo(&ack_frames, QuicTime::Zero(), |
139 /*force_all_paths=*/false); | 141 /*force_all_paths=*/false); |
(...skipping 27 matching lines...) Expand all Loading... |
167 EXPECT_CALL(*manager_1_, HasNewMissingPackets()).WillOnce(Return(false)); | 169 EXPECT_CALL(*manager_1_, HasNewMissingPackets()).WillOnce(Return(false)); |
168 EXPECT_TRUE(multipath_manager_.HasNewMissingPackets(kDefaultPathId)); | 170 EXPECT_TRUE(multipath_manager_.HasNewMissingPackets(kDefaultPathId)); |
169 EXPECT_FALSE(multipath_manager_.HasNewMissingPackets(kPathId1)); | 171 EXPECT_FALSE(multipath_manager_.HasNewMissingPackets(kPathId1)); |
170 EXPECT_DFATAL(multipath_manager_.HasNewMissingPackets(kPathId2), | 172 EXPECT_DFATAL(multipath_manager_.HasNewMissingPackets(kPathId2), |
171 "Check whether has new missing packets on a non-existent path"); | 173 "Check whether has new missing packets on a non-existent path"); |
172 } | 174 } |
173 | 175 |
174 } // namespace | 176 } // namespace |
175 } // namespace test | 177 } // namespace test |
176 } // namespace net | 178 } // namespace net |
OLD | NEW |