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

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: Moved fix to call.cc and added a better test. 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
« webrtc/call/call.cc ('K') | « 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..140e6b7b3ecad32feac89a1c398507d1533b52c3 100644
--- a/webrtc/video/video_send_stream_tests.cc
+++ b/webrtc/video/video_send_stream_tests.cc
@@ -1121,6 +1121,65 @@ 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),
+ route_changed_(false) {}
+
+ void OnCallsCreated(Call* sender_call, Call* receiver_call) override {
+ call_ = sender_call;
+ }
+
+ Action OnSendRtp(const uint8_t* packet, size_t length) override {
+ if (!route_changed_ &&
+ call_->GetStats().send_bandwidth_bps > kStartBitrateBps) {
+ observation_complete_.Set();
+ }
+ if (route_changed_ &&
+ call_->GetStats().send_bandwidth_bps > kStartBitrateBps) {
terelius 2016/07/07 15:48:38 I don't understand this. The code seems (almost) e
stefan-webrtc 2016/07/08 10:21:59 You are right. This is a complicated way of saying
+ 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);
+ route_changed_ = true;
+ EXPECT_EQ(kStartBitrateBps, call_->GetStats().send_bandwidth_bps);
+
+ ASSERT_TRUE(Wait()) << "Timed out waiting for start bitrate to be "
+ "exceeded after connection switch.";
+ }
+
+ private:
+ Call* call_;
+ bool route_changed_;
+ } test;
+
+ RunBaseTest(&test);
+}
+
class MaxPaddingSetTest : public test::SendTest {
public:
static const uint32_t kMinTransmitBitrateBps = 400000;
« webrtc/call/call.cc ('K') | « webrtc/call/call.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698