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

Unified Diff: webrtc/call/bitrate_allocator_unittest.cc

Issue 1917793002: Remove SendPacer from ViEEncoder (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased Created 4 years, 8 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: webrtc/call/bitrate_allocator_unittest.cc
diff --git a/webrtc/call/bitrate_allocator_unittest.cc b/webrtc/call/bitrate_allocator_unittest.cc
index 6e0cdd4d781e8b1f747f929e5a775fec3499ea13..0f6a82488960953e6e515b180e60c964333b7aa7 100644
--- a/webrtc/call/bitrate_allocator_unittest.cc
+++ b/webrtc/call/bitrate_allocator_unittest.cc
@@ -96,6 +96,12 @@ TEST_F(BitrateAllocatorTest, TwoBitrateObserversOneRtcpObserver) {
allocator_->OnNetworkChanged(1500000, 0, 50);
EXPECT_EQ(600000u, bitrate_observer_1.last_bitrate_);
EXPECT_EQ(600000u, bitrate_observer_2.last_bitrate_);
+
+ // Verify that if the network estimate is set to zero, the allocated rate is
stefan-webrtc 2016/04/29 10:48:38 bandwidth estimate instead of network estimate
perkj_webrtc 2016/05/02 11:29:09 Done.
+ // zero.
+ allocator_->OnNetworkChanged(0, 0, 50);
+ EXPECT_EQ(0u, bitrate_observer_1.last_bitrate_);
+ EXPECT_EQ(0u, bitrate_observer_2.last_bitrate_);
}
class BitrateAllocatorTestNoEnforceMin : public ::testing::Test {
@@ -171,6 +177,13 @@ TEST_F(BitrateAllocatorTestNoEnforceMin, ThreeBitrateObservers) {
EXPECT_EQ(0u, bitrate_observer_2.last_bitrate_);
EXPECT_EQ(0u, bitrate_observer_3.last_bitrate_);
+ allocator_->OnNetworkChanged(0, 0, 0);
+ // Verify that zero estimated bandwidth, means that that all gets zero,
+ // regardless of set min bitrate.
+ EXPECT_EQ(0u, bitrate_observer_1.last_bitrate_);
+ EXPECT_EQ(0u, bitrate_observer_2.last_bitrate_);
+ EXPECT_EQ(0u, bitrate_observer_3.last_bitrate_);
+
allocator_->RemoveObserver(&bitrate_observer_1);
allocator_->RemoveObserver(&bitrate_observer_2);
allocator_->RemoveObserver(&bitrate_observer_3);

Powered by Google App Engine
This is Rietveld 408576698