Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: net/quic/quic_sent_packet_manager_test.cc

Issue 182063002: Add a time based loss detection algorithm to QUIC that loses packets (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_sent_packet_manager.cc ('k') | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_sent_packet_manager.h" 5 #include "net/quic/quic_sent_packet_manager.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" 8 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h"
9 #include "net/quic/test_tools/quic_test_utils.h" 9 #include "net/quic/test_tools/quic_test_utils.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 1126
1127 EXPECT_CALL(*loss_algorithm, GetLossTimeout()) 1127 EXPECT_CALL(*loss_algorithm, GetLossTimeout())
1128 .WillRepeatedly(Return(QuicTime::Zero())); 1128 .WillRepeatedly(Return(QuicTime::Zero()));
1129 SendDataPacket(1); 1129 SendDataPacket(1);
1130 SendDataPacket(2); 1130 SendDataPacket(2);
1131 1131
1132 // Handle an ack which causes the loss algorithm to be evaluated and 1132 // Handle an ack which causes the loss algorithm to be evaluated and
1133 // set the loss timeout. 1133 // set the loss timeout.
1134 EXPECT_CALL(*send_algorithm_, UpdateRtt(_)); 1134 EXPECT_CALL(*send_algorithm_, UpdateRtt(_));
1135 EXPECT_CALL(*send_algorithm_, OnPacketAcked(2, _)); 1135 EXPECT_CALL(*send_algorithm_, OnPacketAcked(2, _));
1136 EXPECT_CALL(*loss_algorithm, DetectLostPackets(_, _, _, _)) 1136 EXPECT_CALL(*loss_algorithm, DetectLostPackets(_, _, _, _, _))
1137 .WillOnce(Return(SequenceNumberSet())); 1137 .WillOnce(Return(SequenceNumberSet()));
1138 ReceivedPacketInfo received_info; 1138 ReceivedPacketInfo received_info;
1139 received_info.largest_observed = 2; 1139 received_info.largest_observed = 2;
1140 received_info.missing_packets.insert(1); 1140 received_info.missing_packets.insert(1);
1141 manager_.OnIncomingAck(received_info, clock_.Now()); 1141 manager_.OnIncomingAck(received_info, clock_.Now());
1142 1142
1143 QuicTime timeout(clock_.Now().Add(QuicTime::Delta::FromMilliseconds(10))); 1143 QuicTime timeout(clock_.Now().Add(QuicTime::Delta::FromMilliseconds(10)));
1144 EXPECT_CALL(*loss_algorithm, GetLossTimeout()) 1144 EXPECT_CALL(*loss_algorithm, GetLossTimeout())
1145 .WillRepeatedly(Return(timeout)); 1145 .WillRepeatedly(Return(timeout));
1146 EXPECT_EQ(timeout, manager_.GetRetransmissionTime()); 1146 EXPECT_EQ(timeout, manager_.GetRetransmissionTime());
1147 1147
1148 // Fire the retransmission timeout and ensure the loss detection algorithm 1148 // Fire the retransmission timeout and ensure the loss detection algorithm
1149 // is invoked. 1149 // is invoked.
1150 EXPECT_CALL(*loss_algorithm, DetectLostPackets(_, _, _, _)) 1150 EXPECT_CALL(*loss_algorithm, DetectLostPackets(_, _, _, _, _))
1151 .WillOnce(Return(SequenceNumberSet())); 1151 .WillOnce(Return(SequenceNumberSet()));
1152 manager_.OnRetransmissionTimeout(); 1152 manager_.OnRetransmissionTimeout();
1153 } 1153 }
1154 1154
1155 } // namespace 1155 } // namespace
1156 } // namespace test 1156 } // namespace test
1157 } // namespace net 1157 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_sent_packet_manager.cc ('k') | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698