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

Unified Diff: net/quic/congestion_control/tcp_cubic_sender_test.cc

Issue 131743009: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use size_t instead of int to fix win_x64 compile error Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender.cc ('k') | net/quic/crypto/crypto_server_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/congestion_control/tcp_cubic_sender_test.cc
diff --git a/net/quic/congestion_control/tcp_cubic_sender_test.cc b/net/quic/congestion_control/tcp_cubic_sender_test.cc
index c76040a210555e4d614fb46de967c086cd8ac80d..f17dda7c4e080b77162f01c1cae9777909f72d4a 100644
--- a/net/quic/congestion_control/tcp_cubic_sender_test.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender_test.cc
@@ -35,14 +35,12 @@ class TcpCubicSenderPeer : public TcpCubicSender {
using TcpCubicSender::AvailableSendWindow;
using TcpCubicSender::SendWindow;
- using TcpCubicSender::AckAccounting;
};
class TcpCubicSenderTest : public ::testing::Test {
protected:
TcpCubicSenderTest()
- : rtt_(QuicTime::Delta::FromMilliseconds(60)),
- one_ms_(QuicTime::Delta::FromMilliseconds(1)),
+ : one_ms_(QuicTime::Delta::FromMilliseconds(1)),
sender_(new TcpCubicSenderPeer(&clock_, true,
kDefaultMaxCongestionWindowTCP)),
receiver_(new TcpReceiver()),
@@ -67,12 +65,12 @@ class TcpCubicSenderTest : public ::testing::Test {
void AckNPackets(int n) {
for (int i = 0; i < n; ++i) {
acked_sequence_number_++;
- sender_->OnPacketAcked(acked_sequence_number_, kDefaultTCPMSS, rtt_);
+ sender_->UpdateRtt(QuicTime::Delta::FromMilliseconds(60));
+ sender_->OnPacketAcked(acked_sequence_number_, kDefaultTCPMSS);
}
clock_.AdvanceTime(one_ms_); // 1 millisecond.
}
- const QuicTime::Delta rtt_;
const QuicTime::Delta one_ms_;
MockClock clock_;
SendAlgorithmInterface::SentPacketsMap not_used_;
@@ -158,12 +156,8 @@ TEST_F(TcpCubicSenderTest, SlowStartAckTrain) {
kDefaultWindowTCP + (kDefaultTCPMSS * 2 * kNumberOfAck);
EXPECT_EQ(expected_send_window, sender_->SendWindow());
EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow());
- // We should now have fallen out of slow start.
- SendAvailableSendWindow();
- AckNPackets(2);
- expected_send_window += kDefaultTCPMSS;
- EXPECT_EQ(expected_send_window, sender_->SendWindow());
+ // We should now have fallen out of slow start.
// Testing Reno phase.
// We should need 141(65*2+1+10) ACK:ed packets before increasing window by
// one.
@@ -261,7 +255,7 @@ TEST_F(TcpCubicSenderTest, RetransmissionDelay) {
const int64 kDeviationMs = 3;
EXPECT_EQ(QuicTime::Delta::Zero(), sender_->RetransmissionDelay());
- sender_->AckAccounting(QuicTime::Delta::FromMilliseconds(kRttMs));
+ sender_->UpdateRtt(QuicTime::Delta::FromMilliseconds(kRttMs));
// Initial value is to set the median deviation to half of the initial
// rtt, the median in then multiplied by a factor of 4 and finally the
@@ -272,9 +266,9 @@ TEST_F(TcpCubicSenderTest, RetransmissionDelay) {
for (int i = 0; i < 100; ++i) {
// Run to make sure that we converge.
- sender_->AckAccounting(
+ sender_->UpdateRtt(
QuicTime::Delta::FromMilliseconds(kRttMs + kDeviationMs));
- sender_->AckAccounting(
+ sender_->UpdateRtt(
QuicTime::Delta::FromMilliseconds(kRttMs - kDeviationMs));
}
expected_delay = QuicTime::Delta::FromMilliseconds(kRttMs + kDeviationMs * 4);
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender.cc ('k') | net/quic/crypto/crypto_server_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698