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

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

Issue 734063004: Update from https://crrev.com/304418 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/hybrid_slow_start.cc ('k') | net/quic/congestion_control/leaky_bucket.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « net/quic/congestion_control/hybrid_slow_start.cc ('k') | net/quic/congestion_control/leaky_bucket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698