From cbc91efaa0f97ca3108268cb6e9b6f9e214b6245 Mon Sep 17 00:00:00 2001 From: Artem Titov Date: Tue, 23 Jul 2019 13:23:20 +0200 Subject: [PATCH] Improve low bandwidth audio test instrumentatin, fix PC test Bug: webrtc:10138 Change-Id: I1d72fcac642064e569f6aac259fd0b6e0cf5c8b3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146603 Reviewed-by: Oskar Sundbom Commit-Queue: Artem Titov Cr-Commit-Position: refs/heads/master@{#28644} --- audio/test/low_bandwidth_audio_test.py | 4 +++- audio/test/pc_low_bandwidth_audio_test.cc | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/audio/test/low_bandwidth_audio_test.py b/audio/test/low_bandwidth_audio_test.py index 8ad820e932..cc6a70eeaf 100755 --- a/audio/test/low_bandwidth_audio_test.py +++ b/audio/test/low_bandwidth_audio_test.py @@ -61,6 +61,8 @@ def _ParseArgs(): help='Path to store perf results in chartjson format.') parser.add_argument('--isolated-script-test-output', default=None, help='Path to output an empty JSON file which Chromium infra requires.') + parser.add_argument('--extra-test-args', default=[], action='append', + help='Extra args to path to the test binary.') # Ignore Chromium-specific flags parser.add_argument('--test-launcher-summary-output', @@ -258,7 +260,7 @@ def main(): _LogCommand(test_command + [ '--sample_rate_hz=%d' % analyzer.sample_rate_hz, '--test_case_prefix=%s' % analyzer.name - ]), + ] + args.extra_test_args), stdout=subprocess.PIPE, stderr=subprocess.STDOUT) perf_results_file = None try: diff --git a/audio/test/pc_low_bandwidth_audio_test.cc b/audio/test/pc_low_bandwidth_audio_test.cc index f2de6c92b2..60fada91ab 100644 --- a/audio/test/pc_low_bandwidth_audio_test.cc +++ b/audio/test/pc_low_bandwidth_audio_test.cc @@ -36,8 +36,8 @@ using AudioConfig = namespace { -constexpr int kTestDurationSec = 6; -constexpr int kQuickTestDurationSec = 1; +constexpr int kTestDurationMs = 5400; +constexpr int kQuickTestDurationMs = 100; std::string GetMetricTestCaseName() { const ::testing::TestInfo* const test_info = @@ -139,8 +139,8 @@ TEST(PCLowBandwidthAudioTest, PCGoodNetworkHighBitrate) { alice->SetAudioConfig(std::move(audio)); }, [](PeerConfigurer* bob) {}); - fixture->Run(RunParams(TimeDelta::seconds( - absl::GetFlag(FLAGS_quick) ? kQuickTestDurationSec : kTestDurationSec))); + fixture->Run(RunParams(TimeDelta::ms( + absl::GetFlag(FLAGS_quick) ? kQuickTestDurationMs : kTestDurationMs))); LogTestResults(); } @@ -164,8 +164,8 @@ TEST(PCLowBandwidthAudioTest, PCMobile2GNetwork) { alice->SetAudioConfig(std::move(audio)); }, [](PeerConfigurer* bob) {}); - fixture->Run(RunParams(TimeDelta::seconds( - absl::GetFlag(FLAGS_quick) ? kQuickTestDurationSec : kTestDurationSec))); + fixture->Run(RunParams(TimeDelta::ms( + absl::GetFlag(FLAGS_quick) ? kQuickTestDurationMs : kTestDurationMs))); LogTestResults(); }