X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fnet%2Fquic%2Fcongestion_control%2Ftime_loss_algorithm_test.cc;h=b964d2863a47a13585f6d2cbc17ccc81bedd66d9;hb=1afa4dd80ef85af7c90efaea6959db1d92330844;hp=bd03e608bcc1cd619ea99874bbc887d145ea2573;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/net/quic/congestion_control/time_loss_algorithm_test.cc b/src/net/quic/congestion_control/time_loss_algorithm_test.cc index bd03e60..b964d28 100644 --- a/src/net/quic/congestion_control/time_loss_algorithm_test.cc +++ b/src/net/quic/congestion_control/time_loss_algorithm_test.cc @@ -26,9 +26,9 @@ class TimeLossAlgorithmTest : public ::testing::Test { void SendDataPacket(QuicPacketSequenceNumber sequence_number) { SerializedPacket packet(sequence_number, PACKET_1BYTE_SEQUENCE_NUMBER, - NULL, 0, new RetransmittableFrames()); - unacked_packets_.AddPacket(packet); - unacked_packets_.SetSent(sequence_number, clock_.Now(), 1000, true); + nullptr, 0, new RetransmittableFrames()); + unacked_packets_.AddSentPacket(packet, 0, NOT_RETRANSMISSION, clock_.Now(), + 1000, true); } void VerifyLosses(QuicPacketSequenceNumber largest_observed, @@ -58,9 +58,9 @@ TEST_F(TimeLossAlgorithmTest, NoLossFor500Nacks) { unacked_packets_.RemoveFromInFlight(2); for (size_t i = 1; i < 500; ++i) { unacked_packets_.NackPacket(1, i); - VerifyLosses(2, NULL, 0); + VerifyLosses(2, nullptr, 0); } - EXPECT_EQ(rtt_stats_.SmoothedRtt().Multiply(1.25), + EXPECT_EQ(rtt_stats_.smoothed_rtt().Multiply(1.25), loss_algorithm_.GetLossTimeout().Subtract(clock_.Now())); } @@ -69,20 +69,20 @@ TEST_F(TimeLossAlgorithmTest, NoLossUntilTimeout) { // Transmit 10 packets at 1/10th an RTT interval. for (size_t i = 1; i <= kNumSentPackets; ++i) { SendDataPacket(i); - clock_.AdvanceTime(rtt_stats_.SmoothedRtt().Multiply(0.1)); + clock_.AdvanceTime(rtt_stats_.smoothed_rtt().Multiply(0.1)); } // Expect the timer to not be set. EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout()); // The packet should not be lost until 1.25 RTTs pass. unacked_packets_.NackPacket(1, 1); unacked_packets_.RemoveFromInFlight(2); - VerifyLosses(2, NULL, 0); + VerifyLosses(2, nullptr, 0); // Expect the timer to be set to 0.25 RTT's in the future. - EXPECT_EQ(rtt_stats_.SmoothedRtt().Multiply(0.25), + EXPECT_EQ(rtt_stats_.smoothed_rtt().Multiply(0.25), loss_algorithm_.GetLossTimeout().Subtract(clock_.Now())); unacked_packets_.NackPacket(1, 5); - VerifyLosses(2, NULL, 0); - clock_.AdvanceTime(rtt_stats_.SmoothedRtt().Multiply(0.25)); + VerifyLosses(2, nullptr, 0); + clock_.AdvanceTime(rtt_stats_.smoothed_rtt().Multiply(0.25)); QuicPacketSequenceNumber lost[] = { 1 }; VerifyLosses(2, lost, arraysize(lost)); EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout()); @@ -93,19 +93,19 @@ TEST_F(TimeLossAlgorithmTest, NoLossWithoutNack) { // Transmit 10 packets at 1/10th an RTT interval. for (size_t i = 1; i <= kNumSentPackets; ++i) { SendDataPacket(i); - clock_.AdvanceTime(rtt_stats_.SmoothedRtt().Multiply(0.1)); + clock_.AdvanceTime(rtt_stats_.smoothed_rtt().Multiply(0.1)); } // Expect the timer to not be set. EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout()); // The packet should not be lost without a nack. unacked_packets_.RemoveFromInFlight(1); - VerifyLosses(1, NULL, 0); + VerifyLosses(1, nullptr, 0); // The timer should still not be set. EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout()); - clock_.AdvanceTime(rtt_stats_.SmoothedRtt().Multiply(0.25)); - VerifyLosses(1, NULL, 0); - clock_.AdvanceTime(rtt_stats_.SmoothedRtt()); - VerifyLosses(1, NULL, 0); + clock_.AdvanceTime(rtt_stats_.smoothed_rtt().Multiply(0.25)); + VerifyLosses(1, nullptr, 0); + clock_.AdvanceTime(rtt_stats_.smoothed_rtt()); + VerifyLosses(1, nullptr, 0); EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout()); } @@ -116,7 +116,7 @@ TEST_F(TimeLossAlgorithmTest, MultipleLossesAtOnce) { for (size_t i = 1; i <= kNumSentPackets; ++i) { SendDataPacket(i); } - clock_.AdvanceTime(rtt_stats_.SmoothedRtt()); + clock_.AdvanceTime(rtt_stats_.smoothed_rtt()); // Expect the timer to not be set. EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout()); // The packet should not be lost until 1.25 RTTs pass. @@ -124,11 +124,11 @@ TEST_F(TimeLossAlgorithmTest, MultipleLossesAtOnce) { unacked_packets_.NackPacket(i, 1); } unacked_packets_.RemoveFromInFlight(10); - VerifyLosses(10, NULL, 0); + VerifyLosses(10, nullptr, 0); // Expect the timer to be set to 0.25 RTT's in the future. - EXPECT_EQ(rtt_stats_.SmoothedRtt().Multiply(0.25), + EXPECT_EQ(rtt_stats_.smoothed_rtt().Multiply(0.25), loss_algorithm_.GetLossTimeout().Subtract(clock_.Now())); - clock_.AdvanceTime(rtt_stats_.SmoothedRtt().Multiply(0.25)); + clock_.AdvanceTime(rtt_stats_.smoothed_rtt().Multiply(0.25)); QuicPacketSequenceNumber lost[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; VerifyLosses(10, lost, arraysize(lost)); EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout());