// Copyright (c) 2015 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 "quiche/quic/core/congestion_control/cubic_bytes.h" #include <cmath> #include <cstdint> #include "quiche/quic/platform/api/quic_flags.h" #include "quiche/quic/platform/api/quic_test.h" #include "quiche/quic/test_tools/mock_clock.h" namespace quic { namespace test { namespace { const float kBeta = …; // Default Cubic backoff factor. const float kBetaLastMax = …; // Default Cubic backoff factor. const uint32_t kNumConnections = …; const float kNConnectionBeta = …; const float kNConnectionBetaLastMax = …; const float kNConnectionAlpha = …; } // namespace class CubicBytesTest : public QuicTest { … }; // TODO(jokulik): The original "AboveOrigin" test, below, is very // loose. It's nearly impossible to make the test tighter without // deploying the fix for convex mode. Once cubic convex is deployed, // replace "AboveOrigin" with this test. TEST_F(CubicBytesTest, AboveOriginWithTighterBounds) { … } // TODO(ianswett): This test was disabled when all fixes were enabled, but it // may be worth fixing. TEST_F(CubicBytesTest, DISABLED_AboveOrigin) { … } // Constructs an artificial scenario to ensure that cubic-convex // increases are truly fine-grained: // // - After starting the epoch, this test advances the elapsed time // sufficiently far that cubic will do small increases at less than // MaxCubicTimeInterval() intervals. // // - Sets an artificially large initial cwnd to prevent Reno from the // convex increases on every ack. TEST_F(CubicBytesTest, AboveOriginFineGrainedCubing) { … } // Constructs an artificial scenario to show what happens when we // allow per-ack updates, rather than limititing update freqency. In // this scenario, the first two acks of the epoch produce the same // cwnd. When we limit per-ack updates, this would cause the // cessation of cubic updates for 30ms. When we allow per-ack // updates, the window continues to grow on every ack. TEST_F(CubicBytesTest, PerAckUpdates) { … } TEST_F(CubicBytesTest, LossEvents) { … } TEST_F(CubicBytesTest, BelowOrigin) { … } } // namespace test } // namespace quic