Add unittest for congestion window pushback in goog_cc.
Bug: none Change-Id: Idc4ed71d8e12335eeaccbf1181eff36657f122d0 Reviewed-on: https://webrtc-review.googlesource.com/c/116320 Reviewed-by: Sebastian Jansson <srte@webrtc.org> Commit-Queue: Ying Wang <yinwa@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26222}
This commit is contained in:
@ -210,6 +210,42 @@ TEST_F(GoogCcNetworkControllerTest, ReactsToChangedNetworkConditions) {
|
||||
kInitialBitrate * kDefaultPacingRate);
|
||||
}
|
||||
|
||||
// Test congestion window pushback on network delay happens.
|
||||
TEST_F(GoogCcNetworkControllerTest, CongestionWindowPushbackOnNetworkDelay) {
|
||||
ScopedFieldTrials trial(
|
||||
"WebRTC-CongestionWindowPushback/Enabled/WebRTC-CwndExperiment/"
|
||||
"Enabled-800/");
|
||||
Scenario s("googcc_unit/cwnd_on_delay", false);
|
||||
auto send_net = s.CreateSimulationNode([=](NetworkNodeConfig* c) {
|
||||
c->simulation.bandwidth = DataRate::kbps(1000);
|
||||
c->simulation.delay = TimeDelta::ms(100);
|
||||
c->update_frequency = TimeDelta::ms(5);
|
||||
});
|
||||
auto ret_net = s.CreateSimulationNode([](NetworkNodeConfig* c) {
|
||||
c->simulation.delay = TimeDelta::ms(100);
|
||||
c->update_frequency = TimeDelta::ms(5);
|
||||
});
|
||||
SimulatedTimeClientConfig config;
|
||||
config.transport.cc =
|
||||
TransportControllerConfig::CongestionController::kGoogCcFeedback;
|
||||
// Start high so bandwidth drop has max effect.
|
||||
config.transport.rates.start_rate = DataRate::kbps(300);
|
||||
config.transport.rates.max_rate = DataRate::kbps(2000);
|
||||
config.transport.rates.min_rate = DataRate::kbps(10);
|
||||
SimulatedTimeClient* client = s.CreateSimulatedTimeClient(
|
||||
"send", config, {PacketStreamConfig()}, {send_net}, {ret_net});
|
||||
|
||||
s.RunFor(TimeDelta::seconds(10));
|
||||
send_net->PauseTransmissionUntil(s.Now() + TimeDelta::seconds(10));
|
||||
s.RunFor(TimeDelta::seconds(3));
|
||||
|
||||
// After 3 seconds without feedback from any sent packets, we expect that the
|
||||
// target rate is reduced to the minimum pushback threshold
|
||||
// kDefaultMinPushbackTargetBitrateBps, which is defined as 30 kbps in
|
||||
// congestion_window_pushback_controller.
|
||||
EXPECT_LT(client->target_rate_kbps(), 40);
|
||||
}
|
||||
|
||||
TEST_F(GoogCcNetworkControllerTest, OnNetworkRouteChanged) {
|
||||
NetworkControlUpdate update;
|
||||
DataRate new_bitrate = DataRate::bps(200000);
|
||||
|
Reference in New Issue
Block a user