Index: webrtc/voice_engine/test/auto_test/standard/external_media_test.cc |
diff --git a/webrtc/voice_engine/test/auto_test/standard/external_media_test.cc b/webrtc/voice_engine/test/auto_test/standard/external_media_test.cc |
index 4534e128b3a76da6302bc68e8f34383a0463984d..4f86010a18aa099d3970b3048d06c99bd5af11d4 100644 |
--- a/webrtc/voice_engine/test/auto_test/standard/external_media_test.cc |
+++ b/webrtc/voice_engine/test/auto_test/standard/external_media_test.cc |
@@ -107,3 +107,20 @@ |
EXPECT_EQ(0, voe_xmedia_->SetExternalMixing(channel_, false)); |
ResumePlaying(); |
} |
+ |
+TEST_F(ExternalMediaTest, |
+ ExternalMixingResamplingToInvalidFrequenciesFails) { |
+ const int kInvalidFrequencies[] = {-8000, -1}; |
+ webrtc::AudioFrame frame; |
+ PausePlaying(); |
+ EXPECT_EQ(0, voe_xmedia_->SetExternalMixing(channel_, true)); |
+ ResumePlaying(); |
+ for (size_t i = 0; i < arraysize(kInvalidFrequencies); i++) { |
+ int f = kInvalidFrequencies[i]; |
+ EXPECT_EQ(-1, voe_xmedia_->GetAudioFrame(channel_, f, &frame)) |
+ << "Resampling fails for freq=" << f; |
+ } |
+ PausePlaying(); |
+ EXPECT_EQ(0, voe_xmedia_->SetExternalMixing(channel_, false)); |
+ ResumePlaying(); |
+} |