Index: net/quic/congestion_control/hybrid_slow_start_test.cc |
diff --git a/net/quic/congestion_control/hybrid_slow_start_test.cc b/net/quic/congestion_control/hybrid_slow_start_test.cc |
index dd74933840f10bce15ad3367b3b7dfebc9560ddb..bcdf8d900bccd60a80d001a2982505bef5d298cc 100644 |
--- a/net/quic/congestion_control/hybrid_slow_start_test.cc |
+++ b/net/quic/congestion_control/hybrid_slow_start_test.cc |
@@ -54,26 +54,33 @@ TEST_F(HybridSlowStartTest, AckTrain) { |
// At a typical RTT 60 ms, assuming that the inter arrival timestamp is 1 ms, |
// we expect to be able to send a burst of 30 packet before we trigger the |
// ack train detection. |
- const int kMaxLoopCount = 5; |
- QuicPacketSequenceNumber sequence_number = 2; |
- QuicPacketSequenceNumber end_sequence_number = 2; |
- for (int burst = 0; burst < kMaxLoopCount; ++burst) { |
+ // Run this test for both enabled and disabled ack train detection. |
+ for (int i = 0; i < 2; ++i) { |
+ const bool ack_train_detection = (i == 1); |
+ slow_start_->set_ack_train_detection(ack_train_detection); |
+ |
+ const int kMaxLoopCount = 5; |
+ QuicPacketSequenceNumber sequence_number = 2; |
+ QuicPacketSequenceNumber end_sequence_number = 2; |
+ for (int burst = 0; burst < kMaxLoopCount; ++burst) { |
+ slow_start_->StartReceiveRound(end_sequence_number); |
+ do { |
+ clock_.AdvanceTime(one_ms_); |
+ EXPECT_FALSE(slow_start_->ShouldExitSlowStart(rtt_, rtt_, 100)); |
+ } while (!slow_start_->IsEndOfRound(sequence_number++)); |
+ end_sequence_number *= 2; // Exponential growth. |
+ } |
slow_start_->StartReceiveRound(end_sequence_number); |
- do { |
+ |
+ for (int n = 0; |
+ n < 29 && !slow_start_->IsEndOfRound(sequence_number++); ++n) { |
clock_.AdvanceTime(one_ms_); |
EXPECT_FALSE(slow_start_->ShouldExitSlowStart(rtt_, rtt_, 100)); |
- } while (!slow_start_->IsEndOfRound(sequence_number++)); |
- end_sequence_number *= 2; // Exponential growth. |
- } |
- slow_start_->StartReceiveRound(end_sequence_number); |
- |
- for (int n = 0; |
- n < 29 && !slow_start_->IsEndOfRound(sequence_number++); ++n) { |
+ } |
clock_.AdvanceTime(one_ms_); |
- EXPECT_FALSE(slow_start_->ShouldExitSlowStart(rtt_, rtt_, 100)); |
+ EXPECT_EQ(ack_train_detection, |
+ slow_start_->ShouldExitSlowStart(rtt_, rtt_, 100)); |
} |
- clock_.AdvanceTime(one_ms_); |
- EXPECT_TRUE(slow_start_->ShouldExitSlowStart(rtt_, rtt_, 100)); |
} |
TEST_F(HybridSlowStartTest, Delay) { |