Adds support for webrtc::test::ResourcePath on iOS
BUG=webrtc:4752 R=tkchin@webrtc.org Review URL: https://codereview.webrtc.org/1178843002. Cr-Commit-Position: refs/heads/master@{#9445}
This commit is contained in:
@@ -57,7 +57,8 @@ class RTCDataChannelObserver : public DataChannelObserver {
|
||||
};
|
||||
}
|
||||
|
||||
// TODO(tkchin): move to shared location
|
||||
// TODO(henrika): move to shared location.
|
||||
// See https://code.google.com/p/webrtc/issues/detail?id=4773 for details.
|
||||
NSString* NSStringFromStdString(const std::string& stdString) {
|
||||
// std::string may contain null termination character so we construct
|
||||
// using length.
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/test/testsupport/fileutils.h"
|
||||
#include "webrtc/test/testsupport/gtest_disable.h"
|
||||
#include "webrtc_cng.h"
|
||||
|
||||
namespace webrtc {
|
||||
@@ -62,14 +61,14 @@ void CngTest::SetUp() {
|
||||
}
|
||||
|
||||
// Test failing Create.
|
||||
TEST_F(CngTest, DISABLED_ON_IOS(CngCreateFail)) {
|
||||
TEST_F(CngTest, CngCreateFail) {
|
||||
// Test to see that an invalid pointer is caught.
|
||||
EXPECT_EQ(-1, WebRtcCng_CreateEnc(NULL));
|
||||
EXPECT_EQ(-1, WebRtcCng_CreateDec(NULL));
|
||||
}
|
||||
|
||||
// Test normal Create.
|
||||
TEST_F(CngTest, DISABLED_ON_IOS(CngCreate)) {
|
||||
TEST_F(CngTest, CngCreate) {
|
||||
EXPECT_EQ(0, WebRtcCng_CreateEnc(&cng_enc_inst_));
|
||||
EXPECT_EQ(0, WebRtcCng_CreateDec(&cng_dec_inst_));
|
||||
EXPECT_TRUE(cng_enc_inst_ != NULL);
|
||||
@@ -80,7 +79,7 @@ TEST_F(CngTest, DISABLED_ON_IOS(CngCreate)) {
|
||||
}
|
||||
|
||||
// Create CNG encoder, init with faulty values, free CNG encoder.
|
||||
TEST_F(CngTest, DISABLED_ON_IOS(CngInitFail)) {
|
||||
TEST_F(CngTest, CngInitFail) {
|
||||
// Create encoder memory.
|
||||
EXPECT_EQ(0, WebRtcCng_CreateEnc(&cng_enc_inst_));
|
||||
|
||||
@@ -98,7 +97,7 @@ TEST_F(CngTest, DISABLED_ON_IOS(CngInitFail)) {
|
||||
EXPECT_EQ(0, WebRtcCng_FreeEnc(cng_enc_inst_));
|
||||
}
|
||||
|
||||
TEST_F(CngTest, DISABLED_ON_IOS(CngEncode)) {
|
||||
TEST_F(CngTest, CngEncode) {
|
||||
uint8_t sid_data[WEBRTC_CNG_MAX_LPC_ORDER + 1];
|
||||
int16_t number_bytes;
|
||||
|
||||
@@ -150,7 +149,7 @@ TEST_F(CngTest, DISABLED_ON_IOS(CngEncode)) {
|
||||
}
|
||||
|
||||
// Encode Cng with too long input vector.
|
||||
TEST_F(CngTest, DISABLED_ON_IOS(CngEncodeTooLong)) {
|
||||
TEST_F(CngTest, CngEncodeTooLong) {
|
||||
uint8_t sid_data[WEBRTC_CNG_MAX_LPC_ORDER + 1];
|
||||
int16_t number_bytes;
|
||||
|
||||
@@ -169,7 +168,7 @@ TEST_F(CngTest, DISABLED_ON_IOS(CngEncodeTooLong)) {
|
||||
}
|
||||
|
||||
// Call encode without calling init.
|
||||
TEST_F(CngTest, DISABLED_ON_IOS(CngEncodeNoInit)) {
|
||||
TEST_F(CngTest, CngEncodeNoInit) {
|
||||
uint8_t sid_data[WEBRTC_CNG_MAX_LPC_ORDER + 1];
|
||||
int16_t number_bytes;
|
||||
|
||||
@@ -186,7 +185,7 @@ TEST_F(CngTest, DISABLED_ON_IOS(CngEncodeNoInit)) {
|
||||
}
|
||||
|
||||
// Update SID parameters, for both 9 and 16 parameters.
|
||||
TEST_F(CngTest, DISABLED_ON_IOS(CngUpdateSid)) {
|
||||
TEST_F(CngTest, CngUpdateSid) {
|
||||
uint8_t sid_data[WEBRTC_CNG_MAX_LPC_ORDER + 1];
|
||||
int16_t number_bytes;
|
||||
|
||||
@@ -223,7 +222,7 @@ TEST_F(CngTest, DISABLED_ON_IOS(CngUpdateSid)) {
|
||||
}
|
||||
|
||||
// Update SID parameters, with wrong parameters or without calling decode.
|
||||
TEST_F(CngTest, DISABLED_ON_IOS(CngUpdateSidErroneous)) {
|
||||
TEST_F(CngTest, CngUpdateSidErroneous) {
|
||||
uint8_t sid_data[WEBRTC_CNG_MAX_LPC_ORDER + 1];
|
||||
int16_t number_bytes;
|
||||
|
||||
@@ -259,7 +258,7 @@ TEST_F(CngTest, DISABLED_ON_IOS(CngUpdateSidErroneous)) {
|
||||
}
|
||||
|
||||
// Test to generate cng data, by forcing SID. Both normal and faulty condition.
|
||||
TEST_F(CngTest, DISABLED_ON_IOS(CngGenerate)) {
|
||||
TEST_F(CngTest, CngGenerate) {
|
||||
uint8_t sid_data[WEBRTC_CNG_MAX_LPC_ORDER + 1];
|
||||
int16_t out_data[640];
|
||||
int16_t number_bytes;
|
||||
@@ -293,7 +292,7 @@ TEST_F(CngTest, DISABLED_ON_IOS(CngGenerate)) {
|
||||
}
|
||||
|
||||
// Test automatic SID.
|
||||
TEST_F(CngTest, DISABLED_ON_IOS(CngAutoSid)) {
|
||||
TEST_F(CngTest, CngAutoSid) {
|
||||
uint8_t sid_data[WEBRTC_CNG_MAX_LPC_ORDER + 1];
|
||||
int16_t number_bytes;
|
||||
|
||||
@@ -320,7 +319,7 @@ TEST_F(CngTest, DISABLED_ON_IOS(CngAutoSid)) {
|
||||
}
|
||||
|
||||
// Test automatic SID, with very short interval.
|
||||
TEST_F(CngTest, DISABLED_ON_IOS(CngAutoSidShort)) {
|
||||
TEST_F(CngTest, CngAutoSidShort) {
|
||||
uint8_t sid_data[WEBRTC_CNG_MAX_LPC_ORDER + 1];
|
||||
int16_t number_bytes;
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/isac/main/interface/isac.h"
|
||||
#include "webrtc/test/testsupport/fileutils.h"
|
||||
#include "webrtc/test/testsupport/gtest_disable.h"
|
||||
|
||||
struct WebRtcISACStruct;
|
||||
|
||||
@@ -55,24 +54,24 @@ void IsacTest::SetUp() {
|
||||
}
|
||||
|
||||
// Test failing Create.
|
||||
TEST_F(IsacTest, DISABLED_ON_IOS(IsacCreateFail)) {
|
||||
TEST_F(IsacTest, IsacCreateFail) {
|
||||
// Test to see that an invalid pointer is caught.
|
||||
EXPECT_EQ(-1, WebRtcIsac_Create(NULL));
|
||||
}
|
||||
|
||||
// Test failing Free.
|
||||
TEST_F(IsacTest, DISABLED_ON_IOS(IsacFreeFail)) {
|
||||
TEST_F(IsacTest, IsacFreeFail) {
|
||||
// Test to see that free function doesn't crash.
|
||||
EXPECT_EQ(0, WebRtcIsac_Free(NULL));
|
||||
}
|
||||
|
||||
// Test normal Create and Free.
|
||||
TEST_F(IsacTest, DISABLED_ON_IOS(IsacCreateFree)) {
|
||||
TEST_F(IsacTest, IsacCreateFree) {
|
||||
EXPECT_EQ(0, WebRtcIsac_Create(&isac_codec_));
|
||||
EXPECT_TRUE(isac_codec_ != NULL);
|
||||
EXPECT_EQ(0, WebRtcIsac_Free(isac_codec_));}
|
||||
|
||||
TEST_F(IsacTest, DISABLED_ON_IOS(IsacUpdateBWE)) {
|
||||
TEST_F(IsacTest, IsacUpdateBWE) {
|
||||
// Create encoder memory.
|
||||
EXPECT_EQ(0, WebRtcIsac_Create(&isac_codec_));
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "webrtc/modules/audio_coding/codecs/opus/opus_inst.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/tools/audio_loop.h"
|
||||
#include "webrtc/test/testsupport/fileutils.h"
|
||||
#include "webrtc/test/testsupport/gtest_disable.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@@ -248,7 +247,7 @@ void OpusTest::TestDtxEffect(bool dtx) {
|
||||
}
|
||||
|
||||
// Test failing Create.
|
||||
TEST(OpusTest, DISABLED_ON_IOS(OpusCreateFail)) {
|
||||
TEST(OpusTest, OpusCreateFail) {
|
||||
WebRtcOpusEncInst* opus_encoder;
|
||||
WebRtcOpusDecInst* opus_decoder;
|
||||
|
||||
@@ -265,14 +264,14 @@ TEST(OpusTest, DISABLED_ON_IOS(OpusCreateFail)) {
|
||||
}
|
||||
|
||||
// Test failing Free.
|
||||
TEST(OpusTest, DISABLED_ON_IOS(OpusFreeFail)) {
|
||||
TEST(OpusTest, OpusFreeFail) {
|
||||
// Test to see that an invalid pointer is caught.
|
||||
EXPECT_EQ(-1, WebRtcOpus_EncoderFree(NULL));
|
||||
EXPECT_EQ(-1, WebRtcOpus_DecoderFree(NULL));
|
||||
}
|
||||
|
||||
// Test normal Create and Free.
|
||||
TEST_P(OpusTest, DISABLED_ON_IOS(OpusCreateFree)) {
|
||||
TEST_P(OpusTest, OpusCreateFree) {
|
||||
EXPECT_EQ(0, WebRtcOpus_EncoderCreate(&opus_encoder_,
|
||||
channels_,
|
||||
application_));
|
||||
@@ -284,7 +283,7 @@ TEST_P(OpusTest, DISABLED_ON_IOS(OpusCreateFree)) {
|
||||
EXPECT_EQ(0, WebRtcOpus_DecoderFree(opus_decoder_));
|
||||
}
|
||||
|
||||
TEST_P(OpusTest, DISABLED_ON_IOS(OpusEncodeDecode)) {
|
||||
TEST_P(OpusTest, OpusEncodeDecode) {
|
||||
PrepareSpeechData(channels_, 20, 20);
|
||||
|
||||
// Create encoder memory.
|
||||
@@ -322,7 +321,7 @@ TEST_P(OpusTest, DISABLED_ON_IOS(OpusEncodeDecode)) {
|
||||
EXPECT_EQ(0, WebRtcOpus_DecoderFree(opus_decoder_));
|
||||
}
|
||||
|
||||
TEST_P(OpusTest, DISABLED_ON_IOS(OpusSetBitRate)) {
|
||||
TEST_P(OpusTest, OpusSetBitRate) {
|
||||
// Test without creating encoder memory.
|
||||
EXPECT_EQ(-1, WebRtcOpus_SetBitRate(opus_encoder_, 60000));
|
||||
|
||||
@@ -358,7 +357,7 @@ TEST_P(OpusTest, OpusSetComplexity) {
|
||||
|
||||
// Encode and decode one frame, initialize the decoder and
|
||||
// decode once more.
|
||||
TEST_P(OpusTest, DISABLED_ON_IOS(OpusDecodeInit)) {
|
||||
TEST_P(OpusTest, OpusDecodeInit) {
|
||||
PrepareSpeechData(channels_, 20, 20);
|
||||
|
||||
// Create encoder memory.
|
||||
@@ -388,7 +387,7 @@ TEST_P(OpusTest, DISABLED_ON_IOS(OpusDecodeInit)) {
|
||||
EXPECT_EQ(0, WebRtcOpus_DecoderFree(opus_decoder_));
|
||||
}
|
||||
|
||||
TEST_P(OpusTest, DISABLED_ON_IOS(OpusEnableDisableFec)) {
|
||||
TEST_P(OpusTest, OpusEnableDisableFec) {
|
||||
// Test without creating encoder memory.
|
||||
EXPECT_EQ(-1, WebRtcOpus_EnableFec(opus_encoder_));
|
||||
EXPECT_EQ(-1, WebRtcOpus_DisableFec(opus_encoder_));
|
||||
@@ -405,7 +404,7 @@ TEST_P(OpusTest, DISABLED_ON_IOS(OpusEnableDisableFec)) {
|
||||
EXPECT_EQ(0, WebRtcOpus_EncoderFree(opus_encoder_));
|
||||
}
|
||||
|
||||
TEST_P(OpusTest, DISABLED_ON_IOS(OpusEnableDisableDtx)) {
|
||||
TEST_P(OpusTest, OpusEnableDisableDtx) {
|
||||
// Test without creating encoder memory.
|
||||
EXPECT_EQ(-1, WebRtcOpus_EnableDtx(opus_encoder_));
|
||||
EXPECT_EQ(-1, WebRtcOpus_DisableDtx(opus_encoder_));
|
||||
@@ -439,15 +438,15 @@ TEST_P(OpusTest, DISABLED_ON_IOS(OpusEnableDisableDtx)) {
|
||||
EXPECT_EQ(0, WebRtcOpus_EncoderFree(opus_encoder_));
|
||||
}
|
||||
|
||||
TEST_P(OpusTest, DISABLED_ON_IOS(OpusDtxOff)) {
|
||||
TEST_P(OpusTest, OpusDtxOff) {
|
||||
TestDtxEffect(false);
|
||||
}
|
||||
|
||||
TEST_P(OpusTest, DISABLED_ON_IOS(OpusDtxOn)) {
|
||||
TEST_P(OpusTest, OpusDtxOn) {
|
||||
TestDtxEffect(true);
|
||||
}
|
||||
|
||||
TEST_P(OpusTest, DISABLED_ON_IOS(OpusSetPacketLossRate)) {
|
||||
TEST_P(OpusTest, OpusSetPacketLossRate) {
|
||||
// Test without creating encoder memory.
|
||||
EXPECT_EQ(-1, WebRtcOpus_SetPacketLossRate(opus_encoder_, 50));
|
||||
|
||||
@@ -464,7 +463,7 @@ TEST_P(OpusTest, DISABLED_ON_IOS(OpusSetPacketLossRate)) {
|
||||
EXPECT_EQ(0, WebRtcOpus_EncoderFree(opus_encoder_));
|
||||
}
|
||||
|
||||
TEST_P(OpusTest, DISABLED_ON_IOS(OpusSetMaxPlaybackRate)) {
|
||||
TEST_P(OpusTest, OpusSetMaxPlaybackRate) {
|
||||
// Test without creating encoder memory.
|
||||
EXPECT_EQ(-1, WebRtcOpus_SetMaxPlaybackRate(opus_encoder_, 20000));
|
||||
|
||||
@@ -489,7 +488,7 @@ TEST_P(OpusTest, DISABLED_ON_IOS(OpusSetMaxPlaybackRate)) {
|
||||
}
|
||||
|
||||
// Test PLC.
|
||||
TEST_P(OpusTest, DISABLED_ON_IOS(OpusDecodePlc)) {
|
||||
TEST_P(OpusTest, OpusDecodePlc) {
|
||||
PrepareSpeechData(channels_, 20, 20);
|
||||
|
||||
// Create encoder memory.
|
||||
@@ -526,7 +525,7 @@ TEST_P(OpusTest, DISABLED_ON_IOS(OpusDecodePlc)) {
|
||||
}
|
||||
|
||||
// Duration estimation.
|
||||
TEST_P(OpusTest, DISABLED_ON_IOS(OpusDurationEstimation)) {
|
||||
TEST_P(OpusTest, OpusDurationEstimation) {
|
||||
PrepareSpeechData(channels_, 20, 20);
|
||||
|
||||
// Create.
|
||||
@@ -560,7 +559,7 @@ TEST_P(OpusTest, DISABLED_ON_IOS(OpusDurationEstimation)) {
|
||||
EXPECT_EQ(0, WebRtcOpus_DecoderFree(opus_decoder_));
|
||||
}
|
||||
|
||||
TEST_P(OpusTest, DISABLED_ON_IOS(OpusDecodeRepacketized)) {
|
||||
TEST_P(OpusTest, OpusDecodeRepacketized) {
|
||||
const int kPackets = 6;
|
||||
|
||||
PrepareSpeechData(channels_, 20, 20 * kPackets);
|
||||
|
||||
@@ -503,18 +503,12 @@ class AcmIsacMtTest : public AudioCodingModuleMtTest {
|
||||
test::AudioLoop audio_loop_;
|
||||
};
|
||||
|
||||
#if defined(WEBRTC_IOS)
|
||||
// See https://code.google.com/p/webrtc/issues/detail?id=4752 for details.
|
||||
#define MAYBE_DoTest DISABLED_DoTest
|
||||
#else
|
||||
#define MAYBE_DoTest DoTest
|
||||
#endif
|
||||
TEST_F(AcmIsacMtTest, MAYBE_DoTest) {
|
||||
TEST_F(AcmIsacMtTest, DoTest) {
|
||||
EXPECT_EQ(kEventSignaled, RunTest());
|
||||
}
|
||||
|
||||
// Disabling all of these tests on iOS until file support has been added.
|
||||
// See https://code.google.com/p/webrtc/issues/detail?id=4752 for details.
|
||||
// Disabling all of these tests on iOS for now.
|
||||
// See https://code.google.com/p/webrtc/issues/detail?id=4768 for details.
|
||||
#if !defined(WEBRTC_IOS)
|
||||
|
||||
class AcmReceiverBitExactness : public ::testing::Test {
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/test/testsupport/fileutils.h"
|
||||
#include "webrtc/test/testsupport/gtest_disable.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@@ -61,13 +60,13 @@ void RunAnalysisTest(const std::string& audio_filename,
|
||||
fclose(data_file);
|
||||
}
|
||||
|
||||
TEST(AudioClassifierTest, DISABLED_ON_IOS(DoAnalysisMono)) {
|
||||
TEST(AudioClassifierTest, DoAnalysisMono) {
|
||||
RunAnalysisTest(test::ResourcePath("short_mixed_mono_48", "pcm"),
|
||||
test::ResourcePath("short_mixed_mono_48", "dat"),
|
||||
1);
|
||||
}
|
||||
|
||||
TEST(AudioClassifierTest, DISABLED_ON_IOS(DoAnalysisStereo)) {
|
||||
TEST(AudioClassifierTest, DoAnalysisStereo) {
|
||||
RunAnalysisTest(test::ResourcePath("short_mixed_stereo_48", "pcm"),
|
||||
test::ResourcePath("short_mixed_stereo_48", "dat"),
|
||||
2);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "webrtc/modules/audio_coding/neteq/tools/neteq_external_decoder_test.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h"
|
||||
#include "webrtc/test/testsupport/fileutils.h"
|
||||
#include "webrtc/test/testsupport/gtest_disable.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@@ -234,7 +233,7 @@ class NetEqExternalVsInternalDecoderTest : public NetEqExternalDecoderUnitTest,
|
||||
int16_t output_[kMaxBlockSize];
|
||||
};
|
||||
|
||||
TEST_F(NetEqExternalVsInternalDecoderTest, DISABLED_ON_IOS(RunTest)) {
|
||||
TEST_F(NetEqExternalVsInternalDecoderTest, RunTest) {
|
||||
RunTest(100); // Run 100 laps @ 10 ms each in the test loop.
|
||||
}
|
||||
|
||||
@@ -329,7 +328,7 @@ class LargeTimestampJumpTest : public NetEqExternalDecoderUnitTest,
|
||||
int16_t output_[kMaxBlockSize];
|
||||
};
|
||||
|
||||
TEST_F(LargeTimestampJumpTest, DISABLED_ON_IOS(JumpLongerThanHalfRange)) {
|
||||
TEST_F(LargeTimestampJumpTest, JumpLongerThanHalfRange) {
|
||||
// Set the timestamp series to start at 2880, increase to 7200, then jump to
|
||||
// 2869342376. The sequence numbers start at 42076 and increase by 1 for each
|
||||
// packet, also when the timestamp jumps.
|
||||
@@ -353,8 +352,7 @@ TEST_F(LargeTimestampJumpTest, DISABLED_ON_IOS(JumpLongerThanHalfRange)) {
|
||||
EXPECT_EQ(kRecovered, test_state_);
|
||||
}
|
||||
|
||||
TEST_F(LargeTimestampJumpTest,
|
||||
DISABLED_ON_IOS(JumpLongerThanHalfRangeAndWrap)) {
|
||||
TEST_F(LargeTimestampJumpTest, JumpLongerThanHalfRangeAndWrap) {
|
||||
// Make a jump larger than half the 32-bit timestamp range. Set the start
|
||||
// timestamp such that the jump will result in a wrap around.
|
||||
static const uint16_t kStartSeqeunceNumber = 42076;
|
||||
@@ -413,7 +411,7 @@ class ShortTimestampJumpTest : public LargeTimestampJumpTest {
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(ShortTimestampJumpTest, DISABLED_ON_IOS(JumpShorterThanHalfRange)) {
|
||||
TEST_F(ShortTimestampJumpTest, JumpShorterThanHalfRange) {
|
||||
// Make a jump shorter than half the 32-bit timestamp range. Set the start
|
||||
// timestamp such that the jump will not result in a wrap around.
|
||||
static const uint16_t kStartSeqeunceNumber = 42076;
|
||||
@@ -437,8 +435,7 @@ TEST_F(ShortTimestampJumpTest, DISABLED_ON_IOS(JumpShorterThanHalfRange)) {
|
||||
EXPECT_EQ(kRecovered, test_state_);
|
||||
}
|
||||
|
||||
TEST_F(ShortTimestampJumpTest,
|
||||
DISABLED_ON_IOS(JumpShorterThanHalfRangeAndWrap)) {
|
||||
TEST_F(ShortTimestampJumpTest, JumpShorterThanHalfRangeAndWrap) {
|
||||
// Make a jump shorter than half the 32-bit timestamp range. Set the start
|
||||
// timestamp such that the jump will result in a wrap around.
|
||||
static const uint16_t kStartSeqeunceNumber = 42076;
|
||||
|
||||
@@ -438,8 +438,6 @@ void NetEqDecodingTest::PopulateCng(int frame_index,
|
||||
*payload_len = 1; // Only noise level, no spectral parameters.
|
||||
}
|
||||
|
||||
// TODO(henrika): add support for IOS for all tests in this file.
|
||||
// See https://code.google.com/p/webrtc/issues/detail?id=4752 for details.
|
||||
TEST_F(NetEqDecodingTest,
|
||||
DISABLED_ON_IOS(DISABLED_ON_ANDROID(TestBitExactness))) {
|
||||
const std::string input_rtp_file = webrtc::test::ProjectRootPath() +
|
||||
@@ -1056,19 +1054,19 @@ class NetEqBgnTestFade : public NetEqBgnTest {
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(NetEqBgnTestOn, DISABLED_ON_IOS(RunTest)) {
|
||||
TEST_F(NetEqBgnTestOn, RunTest) {
|
||||
CheckBgn(8000);
|
||||
CheckBgn(16000);
|
||||
CheckBgn(32000);
|
||||
}
|
||||
|
||||
TEST_F(NetEqBgnTestOff, DISABLED_ON_IOS(RunTest)) {
|
||||
TEST_F(NetEqBgnTestOff, RunTest) {
|
||||
CheckBgn(8000);
|
||||
CheckBgn(16000);
|
||||
CheckBgn(32000);
|
||||
}
|
||||
|
||||
TEST_F(NetEqBgnTestFade, DISABLED_ON_IOS(RunTest)) {
|
||||
TEST_F(NetEqBgnTestFade, RunTest) {
|
||||
CheckBgn(8000);
|
||||
CheckBgn(16000);
|
||||
CheckBgn(32000);
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/background_noise.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h"
|
||||
#include "webrtc/test/testsupport/gtest_disable.h"
|
||||
#include "webrtc/test/testsupport/fileutils.h"
|
||||
|
||||
namespace webrtc {
|
||||
@@ -109,7 +108,7 @@ class TimeStretchTest : public ::testing::Test {
|
||||
BackgroundNoise background_noise_;
|
||||
};
|
||||
|
||||
TEST_F(TimeStretchTest, DISABLED_ON_IOS(Accelerate)) {
|
||||
TEST_F(TimeStretchTest, Accelerate) {
|
||||
// TestAccelerate returns the total length change in samples.
|
||||
EXPECT_EQ(15268, TestAccelerate(100, false));
|
||||
EXPECT_EQ(9, return_stats_[TimeStretch::kSuccess]);
|
||||
@@ -117,7 +116,7 @@ TEST_F(TimeStretchTest, DISABLED_ON_IOS(Accelerate)) {
|
||||
EXPECT_EQ(33, return_stats_[TimeStretch::kNoStretch]);
|
||||
}
|
||||
|
||||
TEST_F(TimeStretchTest, DISABLED_ON_IOS(AccelerateFastMode)) {
|
||||
TEST_F(TimeStretchTest, AccelerateFastMode) {
|
||||
// TestAccelerate returns the total length change in samples.
|
||||
EXPECT_EQ(21400, TestAccelerate(100, true));
|
||||
EXPECT_EQ(31, return_stats_[TimeStretch::kSuccess]);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "webrtc/test/testsupport/fileutils.h"
|
||||
#include "webrtc/test/testsupport/gtest_disable.h"
|
||||
#include "webrtc/modules/audio_processing/agc/utility.h"
|
||||
|
||||
namespace webrtc {
|
||||
@@ -90,13 +89,13 @@ void HistogramTest::RunTest(bool enable_circular_buff, const char* filename) {
|
||||
fclose(in_file);
|
||||
}
|
||||
|
||||
TEST_F(HistogramTest, DISABLED_ON_IOS(ActiveCircularBuffer)) {
|
||||
TEST_F(HistogramTest, ActiveCircularBuffer) {
|
||||
RunTest(true,
|
||||
test::ResourcePath("audio_processing/agc/agc_with_circular_buffer",
|
||||
"dat").c_str());
|
||||
}
|
||||
|
||||
TEST_F(HistogramTest, DISABLED_ON_IOS(InactiveCircularBuffer)) {
|
||||
TEST_F(HistogramTest, InactiveCircularBuffer) {
|
||||
RunTest(false,
|
||||
test::ResourcePath("audio_processing/agc/agc_no_circular_buffer",
|
||||
"dat").c_str());
|
||||
|
||||
@@ -16,11 +16,10 @@
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "webrtc/test/testsupport/fileutils.h"
|
||||
#include "webrtc/test/testsupport/gtest_disable.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
TEST(PitchBasedVadTest, DISABLED_ON_IOS(VoicingProbabilityTest)) {
|
||||
TEST(PitchBasedVadTest, VoicingProbabilityTest) {
|
||||
std::string spectral_peak_file_name = test::ResourcePath(
|
||||
"audio_processing/agc/agc_spectral_peak", "dat");
|
||||
FILE* spectral_peak_file = fopen(spectral_peak_file_name.c_str(), "rb");
|
||||
|
||||
@@ -345,6 +345,23 @@
|
||||
'audio_device/android/fine_audio_buffer_unittest.cc',
|
||||
],
|
||||
}],
|
||||
['OS=="ios"', {
|
||||
'mac_bundle_resources': [
|
||||
'<(DEPTH)/resources/audio_coding/speech_mono_16kHz.pcm',
|
||||
'<(DEPTH)/resources/audio_coding/testfile32kHz.pcm',
|
||||
'<(DEPTH)/resources/audio_coding/teststereo32kHz.pcm',
|
||||
'<(DEPTH)/resources/audio_processing/agc/agc_no_circular_buffer.dat',
|
||||
'<(DEPTH)/resources/audio_processing/agc/agc_pitch_gain.dat',
|
||||
'<(DEPTH)/resources/audio_processing/agc/agc_pitch_lag.dat',
|
||||
'<(DEPTH)/resources/audio_processing/agc/agc_spectral_peak.dat',
|
||||
'<(DEPTH)/resources/audio_processing/agc/agc_voicing_prob.dat',
|
||||
'<(DEPTH)/resources/audio_processing/agc/agc_with_circular_buffer.dat',
|
||||
'<(DEPTH)/resources/short_mixed_mono_48.dat',
|
||||
'<(DEPTH)/resources/short_mixed_mono_48.pcm',
|
||||
'<(DEPTH)/resources/short_mixed_stereo_48.dat',
|
||||
'<(DEPTH)/resources/short_mixed_stereo_48.pcm',
|
||||
],
|
||||
}],
|
||||
],
|
||||
# Disable warnings to enable Win64 build, issue 1323.
|
||||
'msvs_disabled_warnings': [
|
||||
|
||||
@@ -124,6 +124,7 @@
|
||||
'testsupport/frame_writer.cc',
|
||||
'testsupport/frame_writer.h',
|
||||
'testsupport/gtest_disable.h',
|
||||
'testsupport/iosfileutils.mm',
|
||||
'testsupport/mock/mock_frame_reader.h',
|
||||
'testsupport/mock/mock_frame_writer.h',
|
||||
'testsupport/packet_reader.cc',
|
||||
@@ -133,6 +134,13 @@
|
||||
'testsupport/trace_to_stderr.cc',
|
||||
'testsupport/trace_to_stderr.h',
|
||||
],
|
||||
'conditions': [
|
||||
['OS=="ios"', {
|
||||
'xcode_settings': {
|
||||
'CLANG_ENABLE_OBJC_ARC': 'YES',
|
||||
},
|
||||
}],
|
||||
],
|
||||
},
|
||||
{
|
||||
# Depend on this target when you want to have test_support but also the
|
||||
|
||||
@@ -41,6 +41,11 @@
|
||||
namespace webrtc {
|
||||
namespace test {
|
||||
|
||||
#if defined(WEBRTC_IOS)
|
||||
// Defined in iosfileutils.mm. No header file to discourage use elsewhere.
|
||||
std::string IOSResourcePath(std::string name, std::string extension);
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -57,7 +62,9 @@ const char* kProjectRootFileName = "DEPS";
|
||||
const char* kOutputDirName = "out";
|
||||
const char* kFallbackPath = "./";
|
||||
#endif
|
||||
#if !defined(WEBRTC_IOS)
|
||||
const char* kResourcesDirName = "resources";
|
||||
#endif
|
||||
|
||||
char relative_dir_path[FILENAME_MAX];
|
||||
bool relative_dir_path_set = false;
|
||||
@@ -205,6 +212,9 @@ bool CreateDir(std::string directory_name) {
|
||||
}
|
||||
|
||||
std::string ResourcePath(std::string name, std::string extension) {
|
||||
#if defined(WEBRTC_IOS)
|
||||
return IOSResourcePath(name, extension);
|
||||
#else
|
||||
std::string platform = "win";
|
||||
#ifdef WEBRTC_LINUX
|
||||
platform = "linux";
|
||||
@@ -239,6 +249,7 @@ std::string ResourcePath(std::string name, std::string extension) {
|
||||
|
||||
// Fall back on name without architecture or platform.
|
||||
return resources_path + name + "." + extension;
|
||||
#endif // defined (WEBRTC_IOS)
|
||||
}
|
||||
|
||||
size_t GetFileSize(std::string filename) {
|
||||
|
||||
60
webrtc/test/testsupport/iosfileutils.mm
Normal file
60
webrtc/test/testsupport/iosfileutils.mm
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC Project Authors. All rights reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#if defined(WEBRTC_IOS)
|
||||
|
||||
#if !defined(__has_feature) || !__has_feature(objc_arc)
|
||||
#error "This file requires ARC support."
|
||||
#endif
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace test {
|
||||
|
||||
// TODO(henrika): move to shared location.
|
||||
// See https://code.google.com/p/webrtc/issues/detail?id=4773 for details.
|
||||
NSString* NSStringFromStdString(const std::string& stdString) {
|
||||
// std::string may contain null termination character so we construct
|
||||
// using length.
|
||||
return [[NSString alloc] initWithBytes:stdString.data()
|
||||
length:stdString.length()
|
||||
encoding:NSUTF8StringEncoding];
|
||||
}
|
||||
|
||||
std::string StdStringFromNSString(NSString* nsString) {
|
||||
NSData* charData = [nsString dataUsingEncoding:NSUTF8StringEncoding];
|
||||
return std::string(reinterpret_cast<const char*>([charData bytes]),
|
||||
[charData length]);
|
||||
}
|
||||
|
||||
// For iOS, resource files are added to the application bundle in the root
|
||||
// and not in separate folders as is the case for other platforms. This method
|
||||
// therefore removes any prepended folders and uses only the actual file name.
|
||||
std::string IOSResourcePath(std::string name, std::string extension) {
|
||||
@autoreleasepool {
|
||||
NSString* path = NSStringFromStdString(name);
|
||||
NSString* fileName = path.lastPathComponent;
|
||||
NSString* fileType = NSStringFromStdString(extension);
|
||||
// Get full pathname for the resource identified by the name and extension.
|
||||
NSString* pathString = [[NSBundle mainBundle] pathForResource:fileName
|
||||
ofType:fileType];
|
||||
return StdStringFromNSString(pathString);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // defined(WEBRTC_IOS)
|
||||
Reference in New Issue
Block a user