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

Unified Diff: webrtc/audio/test/low_bandwidth_audio_test.cc

Issue 2931873002: Test and fix for huge bwe drop after alr state. (Closed)
Patch Set: . 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/audio/test/low_bandwidth_audio_test.h ('k') | webrtc/modules/congestion_controller/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/audio/test/low_bandwidth_audio_test.cc
diff --git a/webrtc/audio/test/low_bandwidth_audio_test.cc b/webrtc/audio/test/low_bandwidth_audio_test.cc
index 070253e0a171b389663872f69ee6a5bdbfc18ac9..002a10296af18bfff358e81f353460a1306e9ad1 100644
--- a/webrtc/audio/test/low_bandwidth_audio_test.cc
+++ b/webrtc/audio/test/low_bandwidth_audio_test.cc
@@ -11,12 +11,20 @@
#include <algorithm>
#include "gflags/gflags.h"
+
#include "webrtc/audio/test/low_bandwidth_audio_test.h"
+#include "webrtc/base/ptr_util.h"
#include "webrtc/common_audio/wav_file.h"
-#include "webrtc/test/gtest.h"
+#include "webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h"
#include "webrtc/system_wrappers/include/sleep.h"
+#include "webrtc/test/field_trial.h"
+#include "webrtc/test/gmock.h"
+#include "webrtc/test/gtest.h"
#include "webrtc/test/testsupport/fileutils.h"
+using ::testing::NiceMock;
+using ::testing::Invoke;
+using ::testing::_;
DEFINE_int32(sample_rate_hz, 16000,
"Sample rate (Hz) of the produced audio files.");
@@ -26,7 +34,6 @@ DEFINE_bool(quick, false,
"Used to quickly check that the test runs without crashing.");
namespace {
-
// Wait half a second between stopping sending and stopping receiving audio.
constexpr int kExtraRecordTimeMs = 500;
@@ -87,6 +94,7 @@ FakeNetworkPipe::Config AudioQualityTest::GetNetworkPipeConfig() {
test::PacketTransport* AudioQualityTest::CreateSendTransport(
Call* sender_call) {
+ sender_call_ = sender_call;
return new test::PacketTransport(
sender_call, this, test::PacketTransport::kSender,
test::CallTest::payload_type_map_, GetNetworkPipeConfig());
@@ -110,6 +118,8 @@ void AudioQualityTest::ModifyAudioConfigs(
}
void AudioQualityTest::PerformTest() {
+ sender_call_->OnTransportOverheadChanged(webrtc::MediaType::AUDIO, 0);
+
if (FLAGS_quick) {
// Let the recording run for a small amount of time to check if it works.
SleepMs(1000);
@@ -168,5 +178,67 @@ TEST_F(LowBandwidthAudioTest, Mobile2GNetwork) {
RunBaseTest(&test);
}
+class NoBandwidthDropAfterDTX : public AudioQualityTest {
stefan-webrtc 2017/06/16 13:53:27 s/DTX/Dtx
tschumi 2017/06/19 08:49:20 Done.
+ void ModifyAudioConfigs(
+ AudioSendStream::Config* send_config,
+ std::vector<AudioReceiveStream::Config>* receive_configs) override {
+ send_config->send_codec_spec =
+ rtc::Optional<AudioSendStream::Config::SendCodecSpec>(
+ {test::CallTest::kAudioSendPayloadType,
+ {"OPUS",
+ 48000,
+ 2,
+ {{"ptime", "60"}, {"usedtx", "1"}, {"stereo", "1"}}}});
+
+ send_config->min_bitrate_bps = 6000;
+ send_config->max_bitrate_bps = 100000;
+ send_config->rtp.extensions.push_back(
+ RtpExtension(RtpExtension::kTransportSequenceNumberUri,
+ kTransportSequenceNumberExtensionId));
+ for (AudioReceiveStream::Config& recv_config : *receive_configs) {
+ recv_config.rtp.transport_cc = true;
+ recv_config.rtp.extensions = send_config->rtp.extensions;
+ recv_config.rtp.remote_ssrc = send_config->rtp.ssrc;
+ }
+ }
+
+ std::string AudioInputFile() override {
+ return test::ResourcePath("voice_engine/audio_dtx16", "wav");
+ }
+
+ void LogDelayBasedBweUpdate(int32_t bitrate_bps,
stefan-webrtc 2017/06/16 13:53:27 Can't we use Call::GetStats() instead of mocking t
tschumi 2017/06/19 08:49:20 Sure. Done.
+ BandwidthUsage detector_state) {
+ EXPECT_GE(bitrate_bps, 30000);
+ }
+
+ Call::Config GetSenderCallConfig() override {
+ EXPECT_CALL(mock_event_log_, LogDelayBasedBweUpdate(_, _))
+ .WillRepeatedly(
+ Invoke(this, &NoBandwidthDropAfterDTX::LogDelayBasedBweUpdate));
+
+ Call::Config call_config(&mock_event_log_);
+ return call_config;
+ }
+
+ FakeNetworkPipe::Config GetNetworkPipeConfig() override {
+ FakeNetworkPipe::Config pipe_config;
+ pipe_config.link_capacity_kbps = 50;
+ pipe_config.queue_length_packets = 1500;
+ pipe_config.queue_delay_ms = 300;
+ return pipe_config;
+ }
+
+ private:
+ NiceMock<MockRtcEventLog> mock_event_log_;
+};
+
+TEST_F(LowBandwidthAudioTest, NoBandwidthDropAfterDTX) {
+ webrtc::test::ScopedFieldTrials override_field_trials(
+ "WebRTC-Audio-SendSideBwe/Enabled/"
+ "WebRTC-SendSideBwe-WithOverhead/Enabled/");
+ NoBandwidthDropAfterDTX test;
+ RunBaseTest(&test);
+}
+
} // namespace test
} // namespace webrtc
« no previous file with comments | « webrtc/audio/test/low_bandwidth_audio_test.h ('k') | webrtc/modules/congestion_controller/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698