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

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

Issue 2193073003: Move shared files in net/quic/ into net/quic/core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: io_thread_unittest.cc Created 4 years, 5 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
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
deleted file mode 100644
index 18601afd50ce4c5e520392d75fcd6791adf26eed..0000000000000000000000000000000000000000
--- a/net/quic/congestion_control/hybrid_slow_start_test.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/quic/congestion_control/hybrid_slow_start.h"
-
-#include <memory>
-
-#include "base/logging.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace net {
-namespace test {
-
-class HybridSlowStartTest : public ::testing::Test {
- protected:
- HybridSlowStartTest()
- : one_ms_(QuicTime::Delta::FromMilliseconds(1)),
- rtt_(QuicTime::Delta::FromMilliseconds(60)) {}
- void SetUp() override { slow_start_.reset(new HybridSlowStart()); }
- const QuicTime::Delta one_ms_;
- const QuicTime::Delta rtt_;
- std::unique_ptr<HybridSlowStart> slow_start_;
-};
-
-TEST_F(HybridSlowStartTest, Simple) {
- QuicPacketNumber packet_number = 1;
- QuicPacketNumber end_packet_number = 3;
- slow_start_->StartReceiveRound(end_packet_number);
-
- EXPECT_FALSE(slow_start_->IsEndOfRound(packet_number++));
-
- // Test duplicates.
- EXPECT_FALSE(slow_start_->IsEndOfRound(packet_number));
-
- EXPECT_FALSE(slow_start_->IsEndOfRound(packet_number++));
- EXPECT_TRUE(slow_start_->IsEndOfRound(packet_number++));
-
- // Test without a new registered end_packet_number;
- EXPECT_TRUE(slow_start_->IsEndOfRound(packet_number++));
-
- end_packet_number = 20;
- slow_start_->StartReceiveRound(end_packet_number);
- while (packet_number < end_packet_number) {
- EXPECT_FALSE(slow_start_->IsEndOfRound(packet_number++));
- }
- EXPECT_TRUE(slow_start_->IsEndOfRound(packet_number++));
-}
-
-TEST_F(HybridSlowStartTest, Delay) {
- // We expect to detect the increase at +1/8 of the RTT; hence at a typical
- // RTT of 60ms the detection will happen at 67.5 ms.
- const int kHybridStartMinSamples = 8; // Number of acks required to trigger.
-
- QuicPacketNumber end_packet_number = 1;
- slow_start_->StartReceiveRound(end_packet_number++);
-
- // Will not trigger since our lowest RTT in our burst is the same as the long
- // term RTT provided.
- for (int n = 0; n < kHybridStartMinSamples; ++n) {
- EXPECT_FALSE(slow_start_->ShouldExitSlowStart(
- rtt_ + QuicTime::Delta::FromMilliseconds(n), rtt_, 100));
- }
- slow_start_->StartReceiveRound(end_packet_number++);
- for (int n = 1; n < kHybridStartMinSamples; ++n) {
- EXPECT_FALSE(slow_start_->ShouldExitSlowStart(
- rtt_ + QuicTime::Delta::FromMilliseconds(n + 10), rtt_, 100));
- }
- // Expect to trigger since all packets in this burst was above the long term
- // RTT provided.
- EXPECT_TRUE(slow_start_->ShouldExitSlowStart(
- rtt_ + QuicTime::Delta::FromMilliseconds(10), rtt_, 100));
-}
-
-} // namespace test
-} // namespace net
« no previous file with comments | « net/quic/congestion_control/hybrid_slow_start.cc ('k') | net/quic/congestion_control/loss_detection_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698