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/congestion_control/tcp_cubic_sender.h" | 5 #include "net/quic/congestion_control/tcp_cubic_sender.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 // Send our full send window. | 478 // Send our full send window. |
479 SendAvailableSendWindow(); | 479 SendAvailableSendWindow(); |
480 AckNPackets(2); | 480 AckNPackets(2); |
481 } | 481 } |
482 | 482 |
483 QuicByteCount expected_send_window = kMaxCongestionWindowTCP * kDefaultTCPMSS; | 483 QuicByteCount expected_send_window = kMaxCongestionWindowTCP * kDefaultTCPMSS; |
484 EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow()); | 484 EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow()); |
485 } | 485 } |
486 | 486 |
487 TEST_F(TcpCubicSenderTest, TcpCubicResetEpochOnQuiescence) { | 487 TEST_F(TcpCubicSenderTest, TcpCubicResetEpochOnQuiescence) { |
488 ValueRestore<bool> old_flag(&FLAGS_reset_cubic_epoch_when_app_limited, true); | |
489 const int kMaxCongestionWindow = 50; | 488 const int kMaxCongestionWindow = 50; |
490 const QuicByteCount kMaxCongestionWindowBytes = | 489 const QuicByteCount kMaxCongestionWindowBytes = |
491 kMaxCongestionWindow * kDefaultTCPMSS; | 490 kMaxCongestionWindow * kDefaultTCPMSS; |
492 sender_.reset(new TcpCubicSenderPeer(&clock_, false, kMaxCongestionWindow)); | 491 sender_.reset(new TcpCubicSenderPeer(&clock_, false, kMaxCongestionWindow)); |
493 | 492 |
494 int num_sent = SendAvailableSendWindow(); | 493 int num_sent = SendAvailableSendWindow(); |
495 | 494 |
496 // Make sure we fall out of slow start. | 495 // Make sure we fall out of slow start. |
497 QuicByteCount saved_cwnd = sender_->GetCongestionWindow(); | 496 QuicByteCount saved_cwnd = sender_->GetCongestionWindow(); |
498 LoseNPackets(1); | 497 LoseNPackets(1); |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 EXPECT_TRUE(sender_->TimeUntilSend(QuicTime::Zero(), 2 * kDefaultTCPMSS, | 794 EXPECT_TRUE(sender_->TimeUntilSend(QuicTime::Zero(), 2 * kDefaultTCPMSS, |
796 HAS_RETRANSMITTABLE_DATA).IsZero()); | 795 HAS_RETRANSMITTABLE_DATA).IsZero()); |
797 EXPECT_TRUE(sender_->TimeUntilSend(QuicTime::Zero(), 3 * kDefaultTCPMSS, | 796 EXPECT_TRUE(sender_->TimeUntilSend(QuicTime::Zero(), 3 * kDefaultTCPMSS, |
798 HAS_RETRANSMITTABLE_DATA).IsZero()); | 797 HAS_RETRANSMITTABLE_DATA).IsZero()); |
799 EXPECT_FALSE(sender_->TimeUntilSend(QuicTime::Zero(), 4 * kDefaultTCPMSS, | 798 EXPECT_FALSE(sender_->TimeUntilSend(QuicTime::Zero(), 4 * kDefaultTCPMSS, |
800 HAS_RETRANSMITTABLE_DATA).IsZero()); | 799 HAS_RETRANSMITTABLE_DATA).IsZero()); |
801 } | 800 } |
802 | 801 |
803 } // namespace test | 802 } // namespace test |
804 } // namespace net | 803 } // namespace net |
OLD | NEW |