Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: webrtc/modules/audio_coding/neteq/neteq_unittest.cc

Issue 1171033002: Ensures that modules_unittests runs on iOS (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebased Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 size_t* payload_len) { 430 size_t* payload_len) {
431 rtp_info->header.sequenceNumber = frame_index; 431 rtp_info->header.sequenceNumber = frame_index;
432 rtp_info->header.timestamp = timestamp; 432 rtp_info->header.timestamp = timestamp;
433 rtp_info->header.ssrc = 0x1234; // Just an arbitrary SSRC. 433 rtp_info->header.ssrc = 0x1234; // Just an arbitrary SSRC.
434 rtp_info->header.payloadType = 98; // WB CNG. 434 rtp_info->header.payloadType = 98; // WB CNG.
435 rtp_info->header.markerBit = 0; 435 rtp_info->header.markerBit = 0;
436 payload[0] = 64; // Noise level -64 dBov, quite arbitrarily chosen. 436 payload[0] = 64; // Noise level -64 dBov, quite arbitrarily chosen.
437 *payload_len = 1; // Only noise level, no spectral parameters. 437 *payload_len = 1; // Only noise level, no spectral parameters.
438 } 438 }
439 439
440 TEST_F(NetEqDecodingTest, DISABLED_ON_ANDROID(TestBitExactness)) { 440 // TODO(henrika): add support for IOS for all tests in this file.
441 // See https://code.google.com/p/webrtc/issues/detail?id=4752 for details.
442 TEST_F(NetEqDecodingTest,
443 DISABLED_ON_IOS(DISABLED_ON_ANDROID(TestBitExactness))) {
441 const std::string input_rtp_file = webrtc::test::ProjectRootPath() + 444 const std::string input_rtp_file = webrtc::test::ProjectRootPath() +
442 "resources/audio_coding/neteq_universal_new.rtp"; 445 "resources/audio_coding/neteq_universal_new.rtp";
443 // Note that neteq4_universal_ref.pcm and neteq4_universal_ref_win_32.pcm 446 // Note that neteq4_universal_ref.pcm and neteq4_universal_ref_win_32.pcm
444 // are identical. The latter could have been removed, but if clients still 447 // are identical. The latter could have been removed, but if clients still
445 // have a copy of the file, the test will fail. 448 // have a copy of the file, the test will fail.
446 const std::string input_ref_file = 449 const std::string input_ref_file =
447 webrtc::test::ResourcePath("audio_coding/neteq4_universal_ref", "pcm"); 450 webrtc::test::ResourcePath("audio_coding/neteq4_universal_ref", "pcm");
448 #if defined(_MSC_VER) && (_MSC_VER >= 1700) 451 #if defined(_MSC_VER) && (_MSC_VER >= 1700)
449 // For Visual Studio 2012 and later, we will have to use the generic reference 452 // For Visual Studio 2012 and later, we will have to use the generic reference
450 // file, rather than the windows-specific one. 453 // file, rather than the windows-specific one.
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 NetEqBgnTestFade() : NetEqBgnTest() { 1048 NetEqBgnTestFade() : NetEqBgnTest() {
1046 config_.background_noise_mode = NetEq::kBgnFade; 1049 config_.background_noise_mode = NetEq::kBgnFade;
1047 } 1050 }
1048 1051
1049 void TestCondition(double sum_squared_noise, bool should_be_faded) { 1052 void TestCondition(double sum_squared_noise, bool should_be_faded) {
1050 if (should_be_faded) 1053 if (should_be_faded)
1051 EXPECT_EQ(0, sum_squared_noise); 1054 EXPECT_EQ(0, sum_squared_noise);
1052 } 1055 }
1053 }; 1056 };
1054 1057
1055 TEST_F(NetEqBgnTestOn, RunTest) { 1058 TEST_F(NetEqBgnTestOn, DISABLED_ON_IOS(RunTest)) {
1056 CheckBgn(8000); 1059 CheckBgn(8000);
1057 CheckBgn(16000); 1060 CheckBgn(16000);
1058 CheckBgn(32000); 1061 CheckBgn(32000);
1059 } 1062 }
1060 1063
1061 TEST_F(NetEqBgnTestOff, RunTest) { 1064 TEST_F(NetEqBgnTestOff, DISABLED_ON_IOS(RunTest)) {
1062 CheckBgn(8000); 1065 CheckBgn(8000);
1063 CheckBgn(16000); 1066 CheckBgn(16000);
1064 CheckBgn(32000); 1067 CheckBgn(32000);
1065 } 1068 }
1066 1069
1067 TEST_F(NetEqBgnTestFade, RunTest) { 1070 TEST_F(NetEqBgnTestFade, DISABLED_ON_IOS(RunTest)) {
1068 CheckBgn(8000); 1071 CheckBgn(8000);
1069 CheckBgn(16000); 1072 CheckBgn(16000);
1070 CheckBgn(32000); 1073 CheckBgn(32000);
1071 } 1074 }
1072 1075
1073 TEST_F(NetEqDecodingTest, SyncPacketInsert) { 1076 TEST_F(NetEqDecodingTest, SyncPacketInsert) {
1074 WebRtcRTPHeader rtp_info; 1077 WebRtcRTPHeader rtp_info;
1075 uint32_t receive_timestamp = 0; 1078 uint32_t receive_timestamp = 0;
1076 // For the readability use the following payloads instead of the defaults of 1079 // For the readability use the following payloads instead of the defaults of
1077 // this test. 1080 // this test.
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 // Pull audio once. 1534 // Pull audio once.
1532 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, &out_len, 1535 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, &out_len,
1533 &num_channels, &type)); 1536 &num_channels, &type));
1534 ASSERT_EQ(kBlockSize16kHz, out_len); 1537 ASSERT_EQ(kBlockSize16kHz, out_len);
1535 } 1538 }
1536 // Verify speech output. 1539 // Verify speech output.
1537 EXPECT_EQ(kOutputNormal, type); 1540 EXPECT_EQ(kOutputNormal, type);
1538 } 1541 }
1539 1542
1540 } // namespace webrtc 1543 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698