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

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

Issue 2755553003: Ignore packets sent on old network route when receiving feedback. (Closed)
Patch Set: Comments addressed. Created 3 years, 9 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/modules/congestion_controller/congestion_controller_unittest.cc
diff --git a/webrtc/modules/congestion_controller/congestion_controller_unittest.cc b/webrtc/modules/congestion_controller/congestion_controller_unittest.cc
index 802f9d1ea454e317fc60904f10a0e15b2d19d4bb..17d00c86e9c84ef49d238b799faeef0aa026201a 100644
--- a/webrtc/modules/congestion_controller/congestion_controller_unittest.cc
+++ b/webrtc/modules/congestion_controller/congestion_controller_unittest.cc
@@ -215,12 +215,14 @@ TEST_F(CongestionControllerTest, SignalNetworkState) {
controller_->SignalNetworkState(kNetworkDown);
}
-TEST_F(CongestionControllerTest, ResetBweAndBitrates) {
+TEST_F(CongestionControllerTest, OnNetworkRouteChanged) {
int new_bitrate = 200000;
testing::Mock::VerifyAndClearExpectations(pacer_);
EXPECT_CALL(observer_, OnNetworkChanged(new_bitrate, _, _, _));
EXPECT_CALL(*pacer_, SetEstimatedBitrate(new_bitrate));
- controller_->ResetBweAndBitrates(new_bitrate, -1, -1);
+ rtc::NetworkRoute route;
+ route.local_network_id = 1;
+ controller_->OnNetworkRouteChanged(route, new_bitrate, -1, -1);
// If the bitrate is reset to -1, the new starting bitrate will be
// the minimum default bitrate kMinBitrateBps.
@@ -229,7 +231,8 @@ TEST_F(CongestionControllerTest, ResetBweAndBitrates) {
OnNetworkChanged(congestion_controller::GetMinBitrateBps(), _, _, _));
EXPECT_CALL(*pacer_,
SetEstimatedBitrate(congestion_controller::GetMinBitrateBps()));
- controller_->ResetBweAndBitrates(-1, -1, -1);
+ route.local_network_id = 2;
+ controller_->OnNetworkRouteChanged(route, -1, -1, -1);
}
TEST_F(CongestionControllerTest,
@@ -316,13 +319,15 @@ TEST_F(CongestionControllerTest, OnReceivedPacketWithAbsSendTime) {
EXPECT_EQ(header.ssrc, ssrcs[0]);
}
-TEST_F(CongestionControllerTest, ProbeOnBweReset) {
+TEST_F(CongestionControllerTest, ProbeOnRouteChange) {
testing::Mock::VerifyAndClearExpectations(pacer_);
EXPECT_CALL(*pacer_, CreateProbeCluster(kInitialBitrateBps * 6));
EXPECT_CALL(*pacer_, CreateProbeCluster(kInitialBitrateBps * 12));
EXPECT_CALL(observer_, OnNetworkChanged(kInitialBitrateBps * 2, _, _, _));
- controller_->ResetBweAndBitrates(2 * kInitialBitrateBps, 0,
- 20 * kInitialBitrateBps);
+ rtc::NetworkRoute route;
+ route.local_network_id = 1;
+ controller_->OnNetworkRouteChanged(route, 2 * kInitialBitrateBps, 0,
+ 20 * kInitialBitrateBps);
}
// Estimated bitrate reduced when the feedbacks arrive with such a long delay,

Powered by Google App Engine
This is Rietveld 408576698