| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 int f = kValidFrequencies[i]; | 100 int f = kValidFrequencies[i]; |
| 101 EXPECT_EQ(0, voe_xmedia_->GetAudioFrame(channel_, f, &frame)) | 101 EXPECT_EQ(0, voe_xmedia_->GetAudioFrame(channel_, f, &frame)) |
| 102 << "Resampling succeeds for freq=" << f; | 102 << "Resampling succeeds for freq=" << f; |
| 103 EXPECT_EQ(f, frame.sample_rate_hz_); | 103 EXPECT_EQ(f, frame.sample_rate_hz_); |
| 104 EXPECT_EQ(static_cast<size_t>(f / 100), frame.samples_per_channel_); | 104 EXPECT_EQ(static_cast<size_t>(f / 100), frame.samples_per_channel_); |
| 105 } | 105 } |
| 106 PausePlaying(); | 106 PausePlaying(); |
| 107 EXPECT_EQ(0, voe_xmedia_->SetExternalMixing(channel_, false)); | 107 EXPECT_EQ(0, voe_xmedia_->SetExternalMixing(channel_, false)); |
| 108 ResumePlaying(); | 108 ResumePlaying(); |
| 109 } | 109 } |
| 110 | |
| 111 TEST_F(ExternalMediaTest, | |
| 112 ExternalMixingResamplingToInvalidFrequenciesFails) { | |
| 113 const int kInvalidFrequencies[] = {-8000, -1}; | |
| 114 webrtc::AudioFrame frame; | |
| 115 PausePlaying(); | |
| 116 EXPECT_EQ(0, voe_xmedia_->SetExternalMixing(channel_, true)); | |
| 117 ResumePlaying(); | |
| 118 for (size_t i = 0; i < arraysize(kInvalidFrequencies); i++) { | |
| 119 int f = kInvalidFrequencies[i]; | |
| 120 EXPECT_EQ(-1, voe_xmedia_->GetAudioFrame(channel_, f, &frame)) | |
| 121 << "Resampling fails for freq=" << f; | |
| 122 } | |
| 123 PausePlaying(); | |
| 124 EXPECT_EQ(0, voe_xmedia_->SetExternalMixing(channel_, false)); | |
| 125 ResumePlaying(); | |
| 126 } | |
| OLD | NEW |