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

Unified Diff: content/renderer/media/webrtc_audio_capturer_unittest.cc

Issue 227743004: Added a kEchoCancellation constraint to turn off the audio processing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/webrtc_audio_capturer_unittest.cc
diff --git a/content/renderer/media/webrtc_audio_capturer_unittest.cc b/content/renderer/media/webrtc_audio_capturer_unittest.cc
index 8b67aeab8502dbe40c7f903a5f6d2cbf38dc9655..d5f8db44b5478b497f7fc69017d5bf2588651f86 100644
--- a/content/renderer/media/webrtc_audio_capturer_unittest.cc
+++ b/content/renderer/media/webrtc_audio_capturer_unittest.cc
@@ -158,8 +158,8 @@ class WebRtcAudioCapturerTest : public testing::Test {
// those values should be correctly stored and passed to the track.
TEST_F(WebRtcAudioCapturerTest, VerifyAudioParams) {
// Use constraints with default settings.
- blink::WebMediaConstraints constraints;
- VerifyAudioParams(constraints, true);
+ MockMediaConstraintFactory constraint_factory;
+ VerifyAudioParams(constraint_factory.CreateWebMediaConstraints(), true);
}
TEST_F(WebRtcAudioCapturerTest, VerifyAudioParamsWithAudioProcessing) {
@@ -171,4 +171,22 @@ TEST_F(WebRtcAudioCapturerTest, VerifyAudioParamsWithAudioProcessing) {
VerifyAudioParams(constraint_factory.CreateWebMediaConstraints(), false);
}
+TEST_F(WebRtcAudioCapturerTest, FailToCreateCapturerWithWrongConstraints) {
+ EnableAudioTrackProcessing();
+ MockMediaConstraintFactory constraint_factory;
+ const std::string dummy_constraint = "dummy";
+ constraint_factory.AddMandatory(dummy_constraint, true);
+
+ scoped_refptr<WebRtcAudioCapturer> capturer(
+ WebRtcAudioCapturer::CreateCapturer(
+ 0, StreamDeviceInfo(MEDIA_DEVICE_AUDIO_CAPTURE,
+ "", "", params_.sample_rate(),
+ params_.channel_layout(),
+ params_.frames_per_buffer()),
+ constraint_factory.CreateWebMediaConstraints(), NULL, NULL)
+ );
+ EXPECT_TRUE(capturer == NULL);
+}
+
+
} // namespace content
« no previous file with comments | « content/renderer/media/webrtc_audio_capturer.cc ('k') | content/renderer/media/webrtc_local_audio_source_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698