| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include <algorithm> | 11 #include <algorithm> |
| 12 | 12 |
| 13 #include "webrtc/audio/test/low_bandwidth_audio_test.h" | 13 #include "webrtc/audio/test/low_bandwidth_audio_test.h" |
| 14 #include "webrtc/common_audio/wav_file.h" | 14 #include "webrtc/common_audio/wav_file.h" |
| 15 #include "webrtc/test/gtest.h" | 15 #include "webrtc/test/gtest.h" |
| 16 #include "webrtc/test/run_test.h" | |
| 17 #include "webrtc/system_wrappers/include/sleep.h" | 16 #include "webrtc/system_wrappers/include/sleep.h" |
| 18 #include "webrtc/test/testsupport/fileutils.h" | 17 #include "webrtc/test/testsupport/fileutils.h" |
| 19 | 18 |
| 20 namespace { | 19 namespace { |
| 21 // Wait half a second between stopping sending and stopping receiving audio. | 20 // Wait half a second between stopping sending and stopping receiving audio. |
| 22 constexpr int kExtraRecordTimeMs = 500; | 21 constexpr int kExtraRecordTimeMs = 500; |
| 23 | 22 |
| 24 // Large bitrate by default. | 23 // Large bitrate by default. |
| 25 const webrtc::CodecInst kDefaultCodec{120, "OPUS", 48000, 960, 2, 64000}; | 24 const webrtc::CodecInst kDefaultCodec{120, "OPUS", 48000, 960, 2, 64000}; |
| 26 | 25 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // and some extra time to account for network delay. | 99 // and some extra time to account for network delay. |
| 101 SleepMs(GetNetworkPipeConfig().queue_delay_ms + kExtraRecordTimeMs); | 100 SleepMs(GetNetworkPipeConfig().queue_delay_ms + kExtraRecordTimeMs); |
| 102 } | 101 } |
| 103 | 102 |
| 104 void AudioQualityTest::OnTestFinished() { | 103 void AudioQualityTest::OnTestFinished() { |
| 105 const ::testing::TestInfo* const test_info = | 104 const ::testing::TestInfo* const test_info = |
| 106 ::testing::UnitTest::GetInstance()->current_test_info(); | 105 ::testing::UnitTest::GetInstance()->current_test_info(); |
| 107 | 106 |
| 108 // Output information about the input and output audio files so that further | 107 // Output information about the input and output audio files so that further |
| 109 // processing can be done by an external process. | 108 // processing can be done by an external process. |
| 110 printf("TEST %s %s:%s\n", test_info->name(), | 109 printf("TEST %s %s %s\n", test_info->name(), |
| 111 AudioInputFile().c_str(), AudioOutputFile().c_str()); | 110 AudioInputFile().c_str(), AudioOutputFile().c_str()); |
| 112 } | 111 } |
| 113 | 112 |
| 114 | 113 |
| 115 using LowBandwidthAudioTest = CallTest; | 114 using LowBandwidthAudioTest = CallTest; |
| 116 | 115 |
| 117 TEST_F(LowBandwidthAudioTest, GoodNetworkHighBitrate) { | 116 TEST_F(LowBandwidthAudioTest, GoodNetworkHighBitrate) { |
| 118 AudioQualityTest test; | 117 AudioQualityTest test; |
| 119 RunBaseTest(&test); | 118 RunBaseTest(&test); |
| 120 } | 119 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 142 } | 141 } |
| 143 }; | 142 }; |
| 144 | 143 |
| 145 TEST_F(LowBandwidthAudioTest, Mobile2GNetwork) { | 144 TEST_F(LowBandwidthAudioTest, Mobile2GNetwork) { |
| 146 Mobile2GNetworkTest test; | 145 Mobile2GNetworkTest test; |
| 147 RunBaseTest(&test); | 146 RunBaseTest(&test); |
| 148 } | 147 } |
| 149 | 148 |
| 150 } // namespace test | 149 } // namespace test |
| 151 } // namespace webrtc | 150 } // namespace webrtc |
| OLD | NEW |