chromium/net/third_party/quiche/src/quiche/quic/core/congestion_control/bandwidth_sampler_test.cc

// Copyright 2016 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/bandwidth_sampler.h"

#include <algorithm>
#include <cstdint>
#include <set>
#include <string>

#include "quiche/quic/core/quic_bandwidth.h"
#include "quiche/quic/core/quic_time.h"
#include "quiche/quic/core/quic_types.h"
#include "quiche/quic/platform/api/quic_flags.h"
#include "quiche/quic/platform/api/quic_logging.h"
#include "quiche/quic/platform/api/quic_test.h"
#include "quiche/quic/test_tools/mock_clock.h"

namespace quic {
namespace test {

class BandwidthSamplerPeer {};

const QuicByteCount kRegularPacketSize =;
// Enforce divisibility for some of the tests.
static_assert;

struct TestParameters {};

// Used by ::testing::PrintToStringParamName().
std::string PrintToString(const TestParameters& p) {}

// A test fixture with utility methods for BandwidthSampler tests.
class BandwidthSamplerTest : public QuicTestWithParam<TestParameters> {};

INSTANTIATE_TEST_SUITE_P();

// Test the sampler in a simple stop-and-wait sender setting.
TEST_P(BandwidthSamplerTest, SendAndWait) {}

TEST_P(BandwidthSamplerTest, SendTimeState) {}

// Test the sampler during regular windowed sender scenario with fixed
// CWND of 20.
TEST_P(BandwidthSamplerTest, SendPaced) {}

// Test the sampler in a scenario where 50% of packets is consistently lost.
TEST_P(BandwidthSamplerTest, SendWithLosses) {}

// Test the sampler in a scenario where the 50% of packets are not
// congestion controlled (specifically, non-retransmittable data is not
// congestion controlled).  Should be functionally consistent in behavior with
// the SendWithLosses test.
TEST_P(BandwidthSamplerTest, NotCongestionControlled) {}

// Simulate a situation where ACKs arrive in burst and earlier than usual, thus
// producing an ACK rate which is higher than the original send rate.
TEST_P(BandwidthSamplerTest, CompressedAck) {}

// Tests receiving ACK packets in the reverse order.
TEST_P(BandwidthSamplerTest, ReorderedAck) {}

// Test the app-limited logic.
TEST_P(BandwidthSamplerTest, AppLimited) {}

// Test the samples taken at the first flight of packets sent.
TEST_P(BandwidthSamplerTest, FirstRoundTrip) {}

// Test sampler's ability to remove obsolete packets.
TEST_P(BandwidthSamplerTest, RemoveObsoletePackets) {}

TEST_P(BandwidthSamplerTest, NeuterPacket) {}

TEST_P(BandwidthSamplerTest, CongestionEventSampleDefaultValues) {}

// 1) Send 2 packets, 2) Ack both in 1 event, 3) Repeat.
TEST_P(BandwidthSamplerTest, TwoAckedPacketsPerEvent) {}

TEST_P(BandwidthSamplerTest, LoseEveryOtherPacket) {}

TEST_P(BandwidthSamplerTest, AckHeightRespectBandwidthEstimateUpperBound) {}

class MaxAckHeightTrackerTest : public QuicTest {};

TEST_F(MaxAckHeightTrackerTest, VeryAggregatedLargeAck) {}

TEST_F(MaxAckHeightTrackerTest, VeryAggregatedSmallAcks) {}

TEST_F(MaxAckHeightTrackerTest, SomewhatAggregatedLargeAck) {}

TEST_F(MaxAckHeightTrackerTest, SomewhatAggregatedSmallAcks) {}

TEST_F(MaxAckHeightTrackerTest, NotAggregated) {}

TEST_F(MaxAckHeightTrackerTest, StartNewEpochAfterAFullRound) {}

}  // namespace test
}  // namespace quic