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