blob: 113dbe059e2d06d0fead95737f09c50930afdf40 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
tina.legrand@webrtc.org16b6b902012-04-12 11:02:38 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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>
Jonas Olssona4d87372019-07-05 19:08:33 +020012
kjellander@webrtc.org5490c712011-12-21 13:34:18 +000013#include <string>
niklase@google.com470e71d2011-07-07 08:21:25 +000014#include <vector>
15
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020016#include "modules/audio_coding/include/audio_coding_module.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020017#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"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020026#include "test/gtest.h"
Steve Anton10542f22019-01-11 09:11:00 -080027#include "test/testsupport/file_utils.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000028
tina.legrand@webrtc.org50d5ca52012-06-18 13:35:52 +000029TEST(AudioCodingModuleTest, TestAllCodecs) {
Fredrik Solenberg657b2962018-12-05 10:30:25 +010030 webrtc::TestAllCodecs().Perform();
tina.legrand@webrtc.org50d5ca52012-06-18 13:35:52 +000031}
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000032
Peter Boströme2976c82016-01-04 22:44:05 +010033#if defined(WEBRTC_ANDROID)
34TEST(AudioCodingModuleTest, DISABLED_TestEncodeDecode) {
35#else
36TEST(AudioCodingModuleTest, TestEncodeDecode) {
37#endif
Fredrik Solenberg657b2962018-12-05 10:30:25 +010038 webrtc::EncodeDecodeTest().Perform();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000039}
40
Peter Boströme2976c82016-01-04 22:44:05 +010041TEST(AudioCodingModuleTest, TestRedFec) {
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +000042 webrtc::TestRedFec().Perform();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000043}
kwiberg98ab3a42015-09-30 21:54:21 -070044
Peter Boströme2976c82016-01-04 22:44:05 +010045#if defined(WEBRTC_ANDROID)
46TEST(AudioCodingModuleTest, DISABLED_TestIsac) {
47#else
48TEST(AudioCodingModuleTest, TestIsac) {
49#endif
Fredrik Solenberg657b2962018-12-05 10:30:25 +010050 webrtc::ISACTest().Perform();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000051}
52
kwiberg98ab3a42015-09-30 21:54:21 -070053#if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) && \
Karl Wibergeb254b42017-11-01 15:08:12 +010054 defined(WEBRTC_CODEC_ILBC)
Peter Boströme2976c82016-01-04 22:44:05 +010055#if defined(WEBRTC_ANDROID)
56TEST(AudioCodingModuleTest, DISABLED_TwoWayCommunication) {
kwiberg98ab3a42015-09-30 21:54:21 -070057#else
Peter Boströme2976c82016-01-04 22:44:05 +010058TEST(AudioCodingModuleTest, TwoWayCommunication) {
kwiberg98ab3a42015-09-30 21:54:21 -070059#endif
Karl Wiberg3a6b6bd2018-09-26 10:38:45 +020060 webrtc::TwoWayCommunication().Perform();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000061}
Peter Boströme2976c82016-01-04 22:44:05 +010062#endif
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000063
danilchapdc050172017-03-01 01:16:51 -080064// Disabled on ios as flaky, see https://crbug.com/webrtc/7057
65#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
Peter Boströme2976c82016-01-04 22:44:05 +010066TEST(AudioCodingModuleTest, DISABLED_TestStereo) {
67#else
68TEST(AudioCodingModuleTest, TestStereo) {
69#endif
Fredrik Solenberg657b2962018-12-05 10:30:25 +010070 webrtc::TestStereo().Perform();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000071}
72
Peter Boströme2976c82016-01-04 22:44:05 +010073TEST(AudioCodingModuleTest, TestWebRtcVadDtx) {
minyue@webrtc.org05617162015-03-03 12:02:30 +000074 webrtc::TestWebRtcVadDtx().Perform();
minyue@webrtc.org05617162015-03-03 12:02:30 +000075}
76
77TEST(AudioCodingModuleTest, TestOpusDtx) {
minyue@webrtc.org05617162015-03-03 12:02:30 +000078 webrtc::TestOpusDtx().Perform();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000079}
tina.legrand@webrtc.org50d5ca52012-06-18 13:35:52 +000080
danilchapdc050172017-03-01 01:16:51 -080081// Disabled on ios as flaky, see https://crbug.com/webrtc/7057
82#if defined(WEBRTC_IOS)
83TEST(AudioCodingModuleTest, DISABLED_TestOpus) {
84#else
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000085TEST(AudioCodingModuleTest, TestOpus) {
danilchapdc050172017-03-01 01:16:51 -080086#endif
henrik.lundin@webrtc.orgadaf8092014-04-17 08:29:10 +000087 webrtc::OpusTest().Perform();
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000088}
89
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +000090TEST(AudioCodingModuleTest, TestPacketLoss) {
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +000091 webrtc::PacketLossTest(1, 10, 10, 1).Perform();
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +000092}
93
94TEST(AudioCodingModuleTest, TestPacketLossBurst) {
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +000095 webrtc::PacketLossTest(1, 10, 10, 2).Perform();
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +000096}
97
aleloib1a89762017-03-28 02:28:08 -070098// Disabled on ios as flake, see https://crbug.com/webrtc/7057
99#if defined(WEBRTC_IOS)
100TEST(AudioCodingModuleTest, DISABLED_TestPacketLossStereo) {
101#else
Yves Gerey665174f2018-06-19 15:03:05 +0200102TEST(AudioCodingModuleTest, TestPacketLossStereo) {
aleloib1a89762017-03-28 02:28:08 -0700103#endif
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +0000104 webrtc::PacketLossTest(2, 10, 10, 1).Perform();
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +0000105}
106
danilchapdc050172017-03-01 01:16:51 -0800107// Disabled on ios as flake, see https://crbug.com/webrtc/7057
108#if defined(WEBRTC_IOS)
109TEST(AudioCodingModuleTest, DISABLED_TestPacketLossStereoBurst) {
110#else
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +0000111TEST(AudioCodingModuleTest, TestPacketLossStereoBurst) {
danilchapdc050172017-03-01 01:16:51 -0800112#endif
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +0000113 webrtc::PacketLossTest(2, 10, 10, 2).Perform();
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +0000114}
Yves Gerey665174f2018-06-19 15:03:05 +0200115
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
119TEST(AudioCodingModuleTest, TestAPI) {
120 webrtc::APITest().Perform();
121}
122#endif