| OLD | NEW |
| 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 Loading... |
| 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) | |
| 313 TEST_F(AudioCodingModuleTestOldApi, FailOnZeroDesiredFrequency) { | 312 TEST_F(AudioCodingModuleTestOldApi, FailOnZeroDesiredFrequency) { |
| 314 AudioFrame audio_frame; | 313 AudioFrame audio_frame; |
| 315 bool muted; | 314 bool muted; |
| 316 EXPECT_DEATH(acm_->PlayoutData10Ms(0, &audio_frame, &muted), | 315 EXPECT_EQ(-1, acm_->PlayoutData10Ms(0, &audio_frame, &muted)); |
| 317 "dst_sample_rate_hz"); | |
| 318 } | 316 } |
| 319 #endif | |
| 320 | 317 |
| 321 // Checks that the transport callback is invoked once for each speech packet. | 318 // Checks that the transport callback is invoked once for each speech packet. |
| 322 // Also checks that the frame type is kAudioFrameSpeech. | 319 // Also checks that the frame type is kAudioFrameSpeech. |
| 323 TEST_F(AudioCodingModuleTestOldApi, TransportCallbackIsInvokedForEachPacket) { | 320 TEST_F(AudioCodingModuleTestOldApi, TransportCallbackIsInvokedForEachPacket) { |
| 324 const int k10MsBlocksPerPacket = 3; | 321 const int k10MsBlocksPerPacket = 3; |
| 325 codec_.pacsize = k10MsBlocksPerPacket * kSampleRateHz / 100; | 322 codec_.pacsize = k10MsBlocksPerPacket * kSampleRateHz / 100; |
| 326 RegisterCodec(); | 323 RegisterCodec(); |
| 327 const int kLoops = 10; | 324 const int kLoops = 10; |
| 328 for (int i = 0; i < kLoops; ++i) { | 325 for (int i = 0; i < kLoops; ++i) { |
| 329 EXPECT_EQ(i / k10MsBlocksPerPacket, packet_cb_.num_calls()); | 326 EXPECT_EQ(i / k10MsBlocksPerPacket, packet_cb_.num_calls()); |
| (...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1792 Run(16000, 8000, 1000); | 1789 Run(16000, 8000, 1000); |
| 1793 } | 1790 } |
| 1794 | 1791 |
| 1795 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { | 1792 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { |
| 1796 Run(8000, 16000, 1000); | 1793 Run(8000, 16000, 1000); |
| 1797 } | 1794 } |
| 1798 | 1795 |
| 1799 #endif | 1796 #endif |
| 1800 | 1797 |
| 1801 } // namespace webrtc | 1798 } // namespace webrtc |
| OLD | NEW |