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_connection.h" | 5 #include "net/quic/quic_connection.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 SequenceNumberSet lost_packets; | 1159 SequenceNumberSet lost_packets; |
1160 // Create an ack with 256 nacks, none adjacent to one another. | 1160 // Create an ack with 256 nacks, none adjacent to one another. |
1161 for (QuicPacketSequenceNumber i = 1; i <= 256; ++i) { | 1161 for (QuicPacketSequenceNumber i = 1; i <= 256; ++i) { |
1162 NackPacket(i * 2, &frame); | 1162 NackPacket(i * 2, &frame); |
1163 if (i < 256) { // Last packet is nacked, but not lost. | 1163 if (i < 256) { // Last packet is nacked, but not lost. |
1164 lost_packets.insert(i * 2); | 1164 lost_packets.insert(i * 2); |
1165 } | 1165 } |
1166 } | 1166 } |
1167 EXPECT_CALL(*loss_algorithm_, DetectLostPackets(_, _, _, _)) | 1167 EXPECT_CALL(*loss_algorithm_, DetectLostPackets(_, _, _, _)) |
1168 .WillOnce(Return(lost_packets)); | 1168 .WillOnce(Return(lost_packets)); |
1169 EXPECT_CALL(entropy_calculator_, | 1169 EXPECT_CALL(entropy_calculator_, EntropyHash(511)) |
1170 EntropyHash(511)).WillOnce(testing::Return(0)); | 1170 .WillOnce(Return(static_cast<QuicPacketEntropyHash>(0))); |
1171 EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _)); | 1171 EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _)); |
1172 ProcessAckPacket(&frame); | 1172 ProcessAckPacket(&frame); |
1173 | 1173 |
1174 const QuicSentPacketManager& sent_packet_manager = | 1174 const QuicSentPacketManager& sent_packet_manager = |
1175 connection_.sent_packet_manager(); | 1175 connection_.sent_packet_manager(); |
1176 // A truncated ack will not have the true largest observed. | 1176 // A truncated ack will not have the true largest observed. |
1177 EXPECT_GT(num_packets, sent_packet_manager.largest_observed()); | 1177 EXPECT_GT(num_packets, sent_packet_manager.largest_observed()); |
1178 | 1178 |
1179 AckPacket(192, &frame); | 1179 AckPacket(192, &frame); |
1180 | 1180 |
(...skipping 3011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4192 QuicBlockedFrame blocked; | 4192 QuicBlockedFrame blocked; |
4193 blocked.stream_id = 3; | 4193 blocked.stream_id = 3; |
4194 EXPECT_CALL(visitor_, OnBlockedFrames(_)); | 4194 EXPECT_CALL(visitor_, OnBlockedFrames(_)); |
4195 ProcessFramePacket(QuicFrame(&blocked)); | 4195 ProcessFramePacket(QuicFrame(&blocked)); |
4196 EXPECT_TRUE(ack_alarm->IsSet()); | 4196 EXPECT_TRUE(ack_alarm->IsSet()); |
4197 } | 4197 } |
4198 | 4198 |
4199 } // namespace | 4199 } // namespace |
4200 } // namespace test | 4200 } // namespace test |
4201 } // namespace net | 4201 } // namespace net |
OLD | NEW |