xref: /aosp_15_r20/external/webrtc/modules/audio_coding/test/Tester.cc (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1 /*
2  *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3  *
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
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #include <stdio.h>
12 
13 #include <string>
14 #include <vector>
15 
16 #include "modules/audio_coding/include/audio_coding_module.h"
17 #include "modules/audio_coding/test/EncodeDecodeTest.h"
18 #include "modules/audio_coding/test/PacketLossTest.h"
19 #include "modules/audio_coding/test/TestAllCodecs.h"
20 #include "modules/audio_coding/test/TestRedFec.h"
21 #include "modules/audio_coding/test/TestStereo.h"
22 #include "modules/audio_coding/test/TestVADDTX.h"
23 #include "modules/audio_coding/test/TwoWayCommunication.h"
24 #include "modules/audio_coding/test/opus_test.h"
25 #include "test/gtest.h"
26 #include "test/testsupport/file_utils.h"
27 
TEST(AudioCodingModuleTest,TestAllCodecs)28 TEST(AudioCodingModuleTest, TestAllCodecs) {
29   webrtc::TestAllCodecs().Perform();
30 }
31 
32 #if defined(WEBRTC_ANDROID)
TEST(AudioCodingModuleTest,DISABLED_TestEncodeDecode)33 TEST(AudioCodingModuleTest, DISABLED_TestEncodeDecode) {
34 #else
35 TEST(AudioCodingModuleTest, TestEncodeDecode) {
36 #endif
37   webrtc::EncodeDecodeTest().Perform();
38 }
39 
40 TEST(AudioCodingModuleTest, TestRedFec) {
41   webrtc::TestRedFec().Perform();
42 }
43 
44 // Disabled on ios as flaky, see https://crbug.com/webrtc/7057
45 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
46 TEST(AudioCodingModuleTest, DISABLED_TestStereo) {
47 #else
48 TEST(AudioCodingModuleTest, TestStereo) {
49 #endif
50   webrtc::TestStereo().Perform();
51 }
52 
53 TEST(AudioCodingModuleTest, TestWebRtcVadDtx) {
54   webrtc::TestWebRtcVadDtx().Perform();
55 }
56 
57 TEST(AudioCodingModuleTest, TestOpusDtx) {
58   webrtc::TestOpusDtx().Perform();
59 }
60 
61 // Disabled on ios as flaky, see https://crbug.com/webrtc/7057
62 #if defined(WEBRTC_IOS)
63 TEST(AudioCodingModuleTest, DISABLED_TestOpus) {
64 #else
65 TEST(AudioCodingModuleTest, TestOpus) {
66 #endif
67   webrtc::OpusTest().Perform();
68 }
69 
70 TEST(AudioCodingModuleTest, TestPacketLoss) {
71   webrtc::PacketLossTest(1, 10, 10, 1).Perform();
72 }
73 
74 TEST(AudioCodingModuleTest, TestPacketLossBurst) {
75   webrtc::PacketLossTest(1, 10, 10, 2).Perform();
76 }
77 
78 // Disabled on ios as flake, see https://crbug.com/webrtc/7057
79 #if defined(WEBRTC_IOS)
80 TEST(AudioCodingModuleTest, DISABLED_TestPacketLossStereo) {
81 #else
82 TEST(AudioCodingModuleTest, TestPacketLossStereo) {
83 #endif
84   webrtc::PacketLossTest(2, 10, 10, 1).Perform();
85 }
86 
87 // Disabled on ios as flake, see https://crbug.com/webrtc/7057
88 #if defined(WEBRTC_IOS)
89 TEST(AudioCodingModuleTest, DISABLED_TestPacketLossStereoBurst) {
90 #else
91 TEST(AudioCodingModuleTest, TestPacketLossStereoBurst) {
92 #endif
93   webrtc::PacketLossTest(2, 10, 10, 2).Perform();
94 }
95 
96 // The full API test is too long to run automatically on bots, but can be used
97 // for offline testing. User interaction is needed.
98 #ifdef ACM_TEST_FULL_API
99 TEST(AudioCodingModuleTest, TestAPI) {
100   webrtc::APITest().Perform();
101 }
102 #endif
103