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

Side by Side Diff: webrtc/modules/audio_coding/acm2/audio_coding_module_unittest_oldapi.cc

Issue 2007563002: Adding a some checks and switching out a few assert for RTC_[D]CHECK. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove ExternalMixingResamplingToInvalidFrequenciesFails since voe_auto_test has multiple threads r… Created 4 years, 7 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) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 EXPECT_EQ(0, acm_->PlayoutData10Ms(kSampleRateHz, &audio_frame, &muted)); 302 EXPECT_EQ(0, acm_->PlayoutData10Ms(kSampleRateHz, &audio_frame, &muted));
303 ASSERT_FALSE(muted); 303 ASSERT_FALSE(muted);
304 EXPECT_EQ(id_, audio_frame.id_); 304 EXPECT_EQ(id_, audio_frame.id_);
305 EXPECT_EQ(0u, audio_frame.timestamp_); 305 EXPECT_EQ(0u, audio_frame.timestamp_);
306 EXPECT_GT(audio_frame.num_channels_, 0u); 306 EXPECT_GT(audio_frame.num_channels_, 0u);
307 EXPECT_EQ(static_cast<size_t>(kSampleRateHz / 100), 307 EXPECT_EQ(static_cast<size_t>(kSampleRateHz / 100),
308 audio_frame.samples_per_channel_); 308 audio_frame.samples_per_channel_);
309 EXPECT_EQ(kSampleRateHz, audio_frame.sample_rate_hz_); 309 EXPECT_EQ(kSampleRateHz, audio_frame.sample_rate_hz_);
310 } 310 }
311 311
312 #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
312 TEST_F(AudioCodingModuleTestOldApi, FailOnZeroDesiredFrequency) { 313 TEST_F(AudioCodingModuleTestOldApi, FailOnZeroDesiredFrequency) {
313 AudioFrame audio_frame; 314 AudioFrame audio_frame;
314 bool muted; 315 bool muted;
315 EXPECT_EQ(-1, acm_->PlayoutData10Ms(0, &audio_frame, &muted)); 316 EXPECT_DEATH(acm_->PlayoutData10Ms(0, &audio_frame, &muted),
317 "dst_sample_rate_hz");
316 } 318 }
319 #endif
317 320
318 // Checks that the transport callback is invoked once for each speech packet. 321 // Checks that the transport callback is invoked once for each speech packet.
319 // Also checks that the frame type is kAudioFrameSpeech. 322 // Also checks that the frame type is kAudioFrameSpeech.
320 TEST_F(AudioCodingModuleTestOldApi, TransportCallbackIsInvokedForEachPacket) { 323 TEST_F(AudioCodingModuleTestOldApi, TransportCallbackIsInvokedForEachPacket) {
321 const int k10MsBlocksPerPacket = 3; 324 const int k10MsBlocksPerPacket = 3;
322 codec_.pacsize = k10MsBlocksPerPacket * kSampleRateHz / 100; 325 codec_.pacsize = k10MsBlocksPerPacket * kSampleRateHz / 100;
323 RegisterCodec(); 326 RegisterCodec();
324 const int kLoops = 10; 327 const int kLoops = 10;
325 for (int i = 0; i < kLoops; ++i) { 328 for (int i = 0; i < kLoops; ++i) {
326 EXPECT_EQ(i / k10MsBlocksPerPacket, packet_cb_.num_calls()); 329 EXPECT_EQ(i / k10MsBlocksPerPacket, packet_cb_.num_calls());
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after
1789 Run(16000, 8000, 1000); 1792 Run(16000, 8000, 1000);
1790 } 1793 }
1791 1794
1792 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { 1795 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) {
1793 Run(8000, 16000, 1000); 1796 Run(8000, 16000, 1000);
1794 } 1797 }
1795 1798
1796 #endif 1799 #endif
1797 1800
1798 } // namespace webrtc 1801 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/common_audio/resampler/push_resampler_unittest.cc ('k') | webrtc/voice_engine/channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698