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

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

Issue 1893363002: Fix selection of "no audio processing" mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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
« no previous file with comments | « content/renderer/media/media_stream_audio_processor_options.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_audio_processor_unittest.cc
diff --git a/content/renderer/media/media_stream_audio_processor_unittest.cc b/content/renderer/media/media_stream_audio_processor_unittest.cc
index 17247877dfd19d266cd623129b7275f39ff4f285..2e3ea78789fcc190a5e2e7641d6594e821789025 100644
--- a/content/renderer/media/media_stream_audio_processor_unittest.cc
+++ b/content/renderer/media/media_stream_audio_processor_unittest.cc
@@ -342,6 +342,35 @@ TEST_F(MediaStreamAudioProcessorTest, ValidateGoodConstraints) {
EXPECT_TRUE(audio_constraints.IsValid());
}
+TEST_F(MediaStreamAudioProcessorTest, NoEchoTurnsOffProcessing) {
+ {
+ MockConstraintFactory constraint_factory;
+ MediaAudioConstraints audio_constraints(
+ constraint_factory.CreateWebMediaConstraints(), 0);
+ // The default value for echo cancellation is true, except when all
+ // audio processing has been turned off.
+ EXPECT_TRUE(audio_constraints.default_audio_processing_constraint_value());
+ }
+ // Turning off audio processing via a mandatory constraint.
+ {
+ MockConstraintFactory constraint_factory;
+ constraint_factory.basic().echoCancellation.setExact(false);
+ MediaAudioConstraints audio_constraints(
+ constraint_factory.CreateWebMediaConstraints(), 0);
+ // The default value for echo cancellation is true, except when all
+ // audio processing has been turned off.
+ EXPECT_FALSE(audio_constraints.default_audio_processing_constraint_value());
+ }
+ // Turning off audio processing via an optional constraint.
+ {
+ MockConstraintFactory constraint_factory;
+ constraint_factory.AddAdvanced().echoCancellation.setExact(false);
+ MediaAudioConstraints audio_constraints(
+ constraint_factory.CreateWebMediaConstraints(), 0);
+ EXPECT_FALSE(audio_constraints.default_audio_processing_constraint_value());
+ }
+}
+
MediaAudioConstraints MakeMediaAudioConstraints(
const MockConstraintFactory& constraint_factory) {
return MediaAudioConstraints(constraint_factory.CreateWebMediaConstraints(),
« no previous file with comments | « content/renderer/media/media_stream_audio_processor_options.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698