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

Unified Diff: webrtc/modules/congestion_controller/probe_bitrate_estimator_unittest.cc

Issue 2949203002: Only use 95% of the link capacity if the true link capacity is found by probing. (Closed)
Patch Set: Nit Created 3 years, 6 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
« no previous file with comments | « webrtc/modules/congestion_controller/probe_bitrate_estimator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/congestion_controller/probe_bitrate_estimator_unittest.cc
diff --git a/webrtc/modules/congestion_controller/probe_bitrate_estimator_unittest.cc b/webrtc/modules/congestion_controller/probe_bitrate_estimator_unittest.cc
index 5686f57724ca79f63e9ecb0943d4503a51f21aec..7aa3f451b8e6d614e34de1937a967e1754114c7c 100644
--- a/webrtc/modules/congestion_controller/probe_bitrate_estimator_unittest.cc
+++ b/webrtc/modules/congestion_controller/probe_bitrate_estimator_unittest.cc
@@ -23,6 +23,7 @@ namespace {
constexpr int kInvalidBitrate = -1;
constexpr int kDefaultMinProbes = 5;
constexpr int kDefaultMinBytes = 5000;
+constexpr float kTargetUtilizationFraction = 0.95f;
} // anonymous namespace
class TestProbeBitrateEstimator : public ::testing::Test {
@@ -125,8 +126,9 @@ TEST_F(TestProbeBitrateEstimator, SlowReceive) {
AddPacketFeedback(0, 1000, 10, 40);
AddPacketFeedback(0, 1000, 20, 70);
AddPacketFeedback(0, 1000, 30, 85);
+ // Expected send rate = 800 kbps, expected receive rate = 320 kbps.
- EXPECT_NEAR(measured_bps_, 320000, 10);
+ EXPECT_NEAR(measured_bps_, kTargetUtilizationFraction * 320000, 10);
}
TEST_F(TestProbeBitrateEstimator, BurstReceive) {
@@ -143,17 +145,20 @@ TEST_F(TestProbeBitrateEstimator, MultipleClusters) {
AddPacketFeedback(0, 1000, 10, 20);
AddPacketFeedback(0, 1000, 20, 30);
AddPacketFeedback(0, 1000, 40, 60);
- EXPECT_NEAR(measured_bps_, 480000, 10);
+ // Expected send rate = 600 kbps, expected receive rate = 480 kbps.
+ EXPECT_NEAR(measured_bps_, kTargetUtilizationFraction * 480000, 10);
AddPacketFeedback(0, 1000, 50, 60);
+ // Expected send rate = 640 kbps, expected receive rate = 640 kbps.
EXPECT_NEAR(measured_bps_, 640000, 10);
AddPacketFeedback(1, 1000, 60, 70);
AddPacketFeedback(1, 1000, 65, 77);
AddPacketFeedback(1, 1000, 70, 84);
AddPacketFeedback(1, 1000, 75, 90);
+ // Expected send rate = 1600 kbps, expected receive rate = 1200 kbps.
- EXPECT_NEAR(measured_bps_, 1200000, 10);
+ EXPECT_NEAR(measured_bps_, kTargetUtilizationFraction * 1200000, 10);
}
TEST_F(TestProbeBitrateEstimator, IgnoreOldClusters) {
@@ -165,8 +170,9 @@ TEST_F(TestProbeBitrateEstimator, IgnoreOldClusters) {
AddPacketFeedback(1, 1000, 65, 77);
AddPacketFeedback(1, 1000, 70, 84);
AddPacketFeedback(1, 1000, 75, 90);
+ // Expected send rate = 1600 kbps, expected receive rate = 1200 kbps.
- EXPECT_NEAR(measured_bps_, 1200000, 10);
+ EXPECT_NEAR(measured_bps_, kTargetUtilizationFraction * 1200000, 10);
// Coming in 6s later
AddPacketFeedback(0, 1000, 40 + 6000, 60 + 6000);
@@ -180,6 +186,7 @@ TEST_F(TestProbeBitrateEstimator, IgnoreSizeLastSendPacket) {
AddPacketFeedback(0, 1000, 20, 30);
AddPacketFeedback(0, 1000, 30, 40);
AddPacketFeedback(0, 1500, 40, 50);
+ // Expected send rate = 800 kbps, expected receive rate = 900 kbps.
EXPECT_NEAR(measured_bps_, 800000, 10);
}
@@ -189,8 +196,9 @@ TEST_F(TestProbeBitrateEstimator, IgnoreSizeFirstReceivePacket) {
AddPacketFeedback(0, 1000, 10, 20);
AddPacketFeedback(0, 1000, 20, 30);
AddPacketFeedback(0, 1000, 30, 40);
+ // Expected send rate = 933 kbps, expected receive rate = 800 kbps.
- EXPECT_NEAR(measured_bps_, 800000, 10);
+ EXPECT_NEAR(measured_bps_, kTargetUtilizationFraction * 800000, 10);
}
TEST_F(TestProbeBitrateEstimator, NoLastEstimatedBitrateBps) {
« no previous file with comments | « webrtc/modules/congestion_controller/probe_bitrate_estimator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698