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

Unified Diff: webrtc/video/video_send_stream_tests.cc

Issue 2125523004: Fix bug where a connection switch causes BWE to be set to zero. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Comments addressed. Created 4 years, 5 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/call/call.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_send_stream_tests.cc
diff --git a/webrtc/video/video_send_stream_tests.cc b/webrtc/video/video_send_stream_tests.cc
index ddd099900dd3fe66a5b89475bf428f6071875a64..3a8acbc5b5d022718ff31efad0f3e673569596a3 100644
--- a/webrtc/video/video_send_stream_tests.cc
+++ b/webrtc/video/video_send_stream_tests.cc
@@ -1121,6 +1121,54 @@ TEST_F(VideoSendStreamTest, MinTransmitBitrateRespectsRemb) {
RunBaseTest(&test);
}
+TEST_F(VideoSendStreamTest, ChangingNetworkRoute) {
+ class ChangingNetworkRouteTest : public test::EndToEndTest {
+ public:
+ const int kStartBitrateBps = 300000;
+ const int kNewMaxBitrateBps = 1234567;
+
+ ChangingNetworkRouteTest()
+ : EndToEndTest(test::CallTest::kDefaultTimeoutMs),
+ call_(nullptr) {}
+
+ void OnCallsCreated(Call* sender_call, Call* receiver_call) override {
+ call_ = sender_call;
+ }
+
+ Action OnSendRtp(const uint8_t* packet, size_t length) override {
+ if (call_->GetStats().send_bandwidth_bps > kStartBitrateBps) {
+ observation_complete_.Set();
+ }
+
+ return SEND_PACKET;
+ }
+
+ void PerformTest() override {
+ rtc::NetworkRoute new_route(true, 10, 20, -1);
+ call_->OnNetworkRouteChanged("transport", new_route);
+ Call::Config::BitrateConfig bitrate_config;
+ bitrate_config.start_bitrate_bps = kStartBitrateBps;
+ call_->SetBitrateConfig(bitrate_config);
+ EXPECT_TRUE(Wait())
+ << "Timed out while waiting for start bitrate to be exceeded.";
+
+ bitrate_config.start_bitrate_bps = -1;
+ bitrate_config.max_bitrate_bps = kNewMaxBitrateBps;
+ call_->SetBitrateConfig(bitrate_config);
+ // TODO(holmer): We should set the last sent packet id here and verify
+ // that we correctly ignore any packet loss reported prior to that id.
+ ++new_route.local_network_id;
+ call_->OnNetworkRouteChanged("transport", new_route);
+ EXPECT_EQ(kStartBitrateBps, call_->GetStats().send_bandwidth_bps);
+ }
+
+ private:
+ Call* call_;
+ } test;
+
+ RunBaseTest(&test);
+}
+
class MaxPaddingSetTest : public test::SendTest {
public:
static const uint32_t kMinTransmitBitrateBps = 400000;
« no previous file with comments | « webrtc/call/call.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698