niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
tina.legrand@webrtc.org | 16b6b90 | 2012-04-12 11:02:38 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 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> |
kjellander@webrtc.org | 5490c71 | 2011-12-21 13:34:18 +0000 | [diff] [blame] | 12 | #include <string> |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | #include <vector> |
| 14 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 15 | #include "modules/audio_coding/include/audio_coding_module.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 16 | #include "modules/audio_coding/test/EncodeDecodeTest.h" |
| 17 | #include "modules/audio_coding/test/PacketLossTest.h" |
| 18 | #include "modules/audio_coding/test/TestAllCodecs.h" |
| 19 | #include "modules/audio_coding/test/TestRedFec.h" |
| 20 | #include "modules/audio_coding/test/TestStereo.h" |
| 21 | #include "modules/audio_coding/test/TestVADDTX.h" |
| 22 | #include "modules/audio_coding/test/TwoWayCommunication.h" |
| 23 | #include "modules/audio_coding/test/iSACTest.h" |
| 24 | #include "modules/audio_coding/test/opus_test.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 25 | #include "test/gtest.h" |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame^] | 26 | #include "test/testsupport/file_utils.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 27 | |
tina.legrand@webrtc.org | 50d5ca5 | 2012-06-18 13:35:52 +0000 | [diff] [blame] | 28 | TEST(AudioCodingModuleTest, TestAllCodecs) { |
Fredrik Solenberg | 657b296 | 2018-12-05 10:30:25 +0100 | [diff] [blame] | 29 | webrtc::TestAllCodecs().Perform(); |
tina.legrand@webrtc.org | 50d5ca5 | 2012-06-18 13:35:52 +0000 | [diff] [blame] | 30 | } |
tina.legrand@webrtc.org | ee92b66 | 2013-08-27 07:33:51 +0000 | [diff] [blame] | 31 | |
Peter Boström | e2976c8 | 2016-01-04 22:44:05 +0100 | [diff] [blame] | 32 | #if defined(WEBRTC_ANDROID) |
| 33 | TEST(AudioCodingModuleTest, DISABLED_TestEncodeDecode) { |
| 34 | #else |
| 35 | TEST(AudioCodingModuleTest, TestEncodeDecode) { |
| 36 | #endif |
Fredrik Solenberg | 657b296 | 2018-12-05 10:30:25 +0100 | [diff] [blame] | 37 | webrtc::EncodeDecodeTest().Perform(); |
tina.legrand@webrtc.org | ee92b66 | 2013-08-27 07:33:51 +0000 | [diff] [blame] | 38 | } |
| 39 | |
Peter Boström | e2976c8 | 2016-01-04 22:44:05 +0100 | [diff] [blame] | 40 | TEST(AudioCodingModuleTest, TestRedFec) { |
minyue@webrtc.org | aa5ea1c | 2014-05-23 15:16:51 +0000 | [diff] [blame] | 41 | webrtc::TestRedFec().Perform(); |
tina.legrand@webrtc.org | ee92b66 | 2013-08-27 07:33:51 +0000 | [diff] [blame] | 42 | } |
kwiberg | 98ab3a4 | 2015-09-30 21:54:21 -0700 | [diff] [blame] | 43 | |
Peter Boström | e2976c8 | 2016-01-04 22:44:05 +0100 | [diff] [blame] | 44 | #if defined(WEBRTC_ANDROID) |
| 45 | TEST(AudioCodingModuleTest, DISABLED_TestIsac) { |
| 46 | #else |
| 47 | TEST(AudioCodingModuleTest, TestIsac) { |
| 48 | #endif |
Fredrik Solenberg | 657b296 | 2018-12-05 10:30:25 +0100 | [diff] [blame] | 49 | webrtc::ISACTest().Perform(); |
tina.legrand@webrtc.org | ee92b66 | 2013-08-27 07:33:51 +0000 | [diff] [blame] | 50 | } |
| 51 | |
kwiberg | 98ab3a4 | 2015-09-30 21:54:21 -0700 | [diff] [blame] | 52 | #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) && \ |
Karl Wiberg | eb254b4 | 2017-11-01 15:08:12 +0100 | [diff] [blame] | 53 | defined(WEBRTC_CODEC_ILBC) |
Peter Boström | e2976c8 | 2016-01-04 22:44:05 +0100 | [diff] [blame] | 54 | #if defined(WEBRTC_ANDROID) |
| 55 | TEST(AudioCodingModuleTest, DISABLED_TwoWayCommunication) { |
kwiberg | 98ab3a4 | 2015-09-30 21:54:21 -0700 | [diff] [blame] | 56 | #else |
Peter Boström | e2976c8 | 2016-01-04 22:44:05 +0100 | [diff] [blame] | 57 | TEST(AudioCodingModuleTest, TwoWayCommunication) { |
kwiberg | 98ab3a4 | 2015-09-30 21:54:21 -0700 | [diff] [blame] | 58 | #endif |
Karl Wiberg | 3a6b6bd | 2018-09-26 10:38:45 +0200 | [diff] [blame] | 59 | webrtc::TwoWayCommunication().Perform(); |
tina.legrand@webrtc.org | ee92b66 | 2013-08-27 07:33:51 +0000 | [diff] [blame] | 60 | } |
Peter Boström | e2976c8 | 2016-01-04 22:44:05 +0100 | [diff] [blame] | 61 | #endif |
tina.legrand@webrtc.org | ee92b66 | 2013-08-27 07:33:51 +0000 | [diff] [blame] | 62 | |
danilchap | dc05017 | 2017-03-01 01:16:51 -0800 | [diff] [blame] | 63 | // Disabled on ios as flaky, see https://crbug.com/webrtc/7057 |
| 64 | #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
Peter Boström | e2976c8 | 2016-01-04 22:44:05 +0100 | [diff] [blame] | 65 | TEST(AudioCodingModuleTest, DISABLED_TestStereo) { |
| 66 | #else |
| 67 | TEST(AudioCodingModuleTest, TestStereo) { |
| 68 | #endif |
Fredrik Solenberg | 657b296 | 2018-12-05 10:30:25 +0100 | [diff] [blame] | 69 | webrtc::TestStereo().Perform(); |
tina.legrand@webrtc.org | ee92b66 | 2013-08-27 07:33:51 +0000 | [diff] [blame] | 70 | } |
| 71 | |
Peter Boström | e2976c8 | 2016-01-04 22:44:05 +0100 | [diff] [blame] | 72 | TEST(AudioCodingModuleTest, TestWebRtcVadDtx) { |
minyue@webrtc.org | 0561716 | 2015-03-03 12:02:30 +0000 | [diff] [blame] | 73 | webrtc::TestWebRtcVadDtx().Perform(); |
minyue@webrtc.org | 0561716 | 2015-03-03 12:02:30 +0000 | [diff] [blame] | 74 | } |
| 75 | |
| 76 | TEST(AudioCodingModuleTest, TestOpusDtx) { |
minyue@webrtc.org | 0561716 | 2015-03-03 12:02:30 +0000 | [diff] [blame] | 77 | webrtc::TestOpusDtx().Perform(); |
tina.legrand@webrtc.org | ee92b66 | 2013-08-27 07:33:51 +0000 | [diff] [blame] | 78 | } |
tina.legrand@webrtc.org | 50d5ca5 | 2012-06-18 13:35:52 +0000 | [diff] [blame] | 79 | |
danilchap | dc05017 | 2017-03-01 01:16:51 -0800 | [diff] [blame] | 80 | // Disabled on ios as flaky, see https://crbug.com/webrtc/7057 |
| 81 | #if defined(WEBRTC_IOS) |
| 82 | TEST(AudioCodingModuleTest, DISABLED_TestOpus) { |
| 83 | #else |
tina.legrand@webrtc.org | 73222cf | 2013-03-15 13:29:17 +0000 | [diff] [blame] | 84 | TEST(AudioCodingModuleTest, TestOpus) { |
danilchap | dc05017 | 2017-03-01 01:16:51 -0800 | [diff] [blame] | 85 | #endif |
henrik.lundin@webrtc.org | adaf809 | 2014-04-17 08:29:10 +0000 | [diff] [blame] | 86 | webrtc::OpusTest().Perform(); |
tina.legrand@webrtc.org | 73222cf | 2013-03-15 13:29:17 +0000 | [diff] [blame] | 87 | } |
| 88 | |
minyue@webrtc.org | aa5ea1c | 2014-05-23 15:16:51 +0000 | [diff] [blame] | 89 | TEST(AudioCodingModuleTest, TestPacketLoss) { |
minyue@webrtc.org | aa5ea1c | 2014-05-23 15:16:51 +0000 | [diff] [blame] | 90 | webrtc::PacketLossTest(1, 10, 10, 1).Perform(); |
minyue@webrtc.org | aa5ea1c | 2014-05-23 15:16:51 +0000 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | TEST(AudioCodingModuleTest, TestPacketLossBurst) { |
minyue@webrtc.org | aa5ea1c | 2014-05-23 15:16:51 +0000 | [diff] [blame] | 94 | webrtc::PacketLossTest(1, 10, 10, 2).Perform(); |
minyue@webrtc.org | aa5ea1c | 2014-05-23 15:16:51 +0000 | [diff] [blame] | 95 | } |
| 96 | |
aleloi | b1a8976 | 2017-03-28 02:28:08 -0700 | [diff] [blame] | 97 | // Disabled on ios as flake, see https://crbug.com/webrtc/7057 |
| 98 | #if defined(WEBRTC_IOS) |
| 99 | TEST(AudioCodingModuleTest, DISABLED_TestPacketLossStereo) { |
| 100 | #else |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 101 | TEST(AudioCodingModuleTest, TestPacketLossStereo) { |
aleloi | b1a8976 | 2017-03-28 02:28:08 -0700 | [diff] [blame] | 102 | #endif |
minyue@webrtc.org | aa5ea1c | 2014-05-23 15:16:51 +0000 | [diff] [blame] | 103 | webrtc::PacketLossTest(2, 10, 10, 1).Perform(); |
minyue@webrtc.org | aa5ea1c | 2014-05-23 15:16:51 +0000 | [diff] [blame] | 104 | } |
| 105 | |
danilchap | dc05017 | 2017-03-01 01:16:51 -0800 | [diff] [blame] | 106 | // Disabled on ios as flake, see https://crbug.com/webrtc/7057 |
| 107 | #if defined(WEBRTC_IOS) |
| 108 | TEST(AudioCodingModuleTest, DISABLED_TestPacketLossStereoBurst) { |
| 109 | #else |
minyue@webrtc.org | aa5ea1c | 2014-05-23 15:16:51 +0000 | [diff] [blame] | 110 | TEST(AudioCodingModuleTest, TestPacketLossStereoBurst) { |
danilchap | dc05017 | 2017-03-01 01:16:51 -0800 | [diff] [blame] | 111 | #endif |
minyue@webrtc.org | aa5ea1c | 2014-05-23 15:16:51 +0000 | [diff] [blame] | 112 | webrtc::PacketLossTest(2, 10, 10, 2).Perform(); |
minyue@webrtc.org | aa5ea1c | 2014-05-23 15:16:51 +0000 | [diff] [blame] | 113 | } |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 114 | |
| 115 | // The full API test is too long to run automatically on bots, but can be used |
| 116 | // for offline testing. User interaction is needed. |
| 117 | #ifdef ACM_TEST_FULL_API |
| 118 | TEST(AudioCodingModuleTest, TestAPI) { |
| 119 | webrtc::APITest().Perform(); |
| 120 | } |
| 121 | #endif |