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/iSACTest.h"
25 #include "modules/audio_coding/test/opus_test.h"
26 #include "test/gtest.h"
27 #include "test/testsupport/file_utils.h"
28 
TEST(AudioCodingModuleTest,TestAllCodecs)29 TEST(AudioCodingModuleTest, TestAllCodecs) {
30   webrtc::TestAllCodecs().Perform();
31 }
32 
33 #if defined(WEBRTC_ANDROID)
TEST(AudioCodingModuleTest,DISABLED_TestEncodeDecode)34 TEST(AudioCodingModuleTest, DISABLED_TestEncodeDecode) {
35 #else
36 TEST(AudioCodingModuleTest, TestEncodeDecode) {
37 #endif
38   webrtc::EncodeDecodeTest().Perform();
39 }
40 
41 TEST(AudioCodingModuleTest, TestRedFec) {
42   webrtc::TestRedFec().Perform();
43 }
44 
45 #if defined(WEBRTC_ANDROID)
46 TEST(AudioCodingModuleTest, DISABLED_TestIsac) {
47 #else
48 TEST(AudioCodingModuleTest, TestIsac) {
49 #endif
50   webrtc::ISACTest().Perform();
51 }
52 
53 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) && \
54     defined(WEBRTC_CODEC_ILBC)
55 #if defined(WEBRTC_ANDROID)
56 TEST(AudioCodingModuleTest, DISABLED_TwoWayCommunication) {
57 #else
58 TEST(AudioCodingModuleTest, TwoWayCommunication) {
59 #endif
60   webrtc::TwoWayCommunication().Perform();
61 }
62 #endif
63 
64 // Disabled on ios as flaky, see https://crbug.com/webrtc/7057
65 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
66 TEST(AudioCodingModuleTest, DISABLED_TestStereo) {
67 #else
68 TEST(AudioCodingModuleTest, TestStereo) {
69 #endif
70   webrtc::TestStereo().Perform();
71 }
72 
73 TEST(AudioCodingModuleTest, TestWebRtcVadDtx) {
74   webrtc::TestWebRtcVadDtx().Perform();
75 }
76 
77 TEST(AudioCodingModuleTest, TestOpusDtx) {
78   webrtc::TestOpusDtx().Perform();
79 }
80 
81 // Disabled on ios as flaky, see https://crbug.com/webrtc/7057
82 #if defined(WEBRTC_IOS)
83 TEST(AudioCodingModuleTest, DISABLED_TestOpus) {
84 #else
85 TEST(AudioCodingModuleTest, TestOpus) {
86 #endif
87   webrtc::OpusTest().Perform();
88 }
89 
90 TEST(AudioCodingModuleTest, TestPacketLoss) {
91   webrtc::PacketLossTest(1, 10, 10, 1).Perform();
92 }
93 
94 TEST(AudioCodingModuleTest, TestPacketLossBurst) {
95   webrtc::PacketLossTest(1, 10, 10, 2).Perform();
96 }
97 
98 // Disabled on ios as flake, see https://crbug.com/webrtc/7057
99 #if defined(WEBRTC_IOS)
100 TEST(AudioCodingModuleTest, DISABLED_TestPacketLossStereo) {
101 #else
102 TEST(AudioCodingModuleTest, TestPacketLossStereo) {
103 #endif
104   webrtc::PacketLossTest(2, 10, 10, 1).Perform();
105 }
106 
107 // Disabled on ios as flake, see https://crbug.com/webrtc/7057
108 #if defined(WEBRTC_IOS)
109 TEST(AudioCodingModuleTest, DISABLED_TestPacketLossStereoBurst) {
110 #else
111 TEST(AudioCodingModuleTest, TestPacketLossStereoBurst) {
112 #endif
113   webrtc::PacketLossTest(2, 10, 10, 2).Perform();
114 }
115 
116 // The full API test is too long to run automatically on bots, but can be used
117 // for offline testing. User interaction is needed.
118 #ifdef ACM_TEST_FULL_API
119 TEST(AudioCodingModuleTest, TestAPI) {
120   webrtc::APITest().Perform();
121 }
122 #endif
123