Chromium Code Reviews| 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 3f46406c65366c42788536a8d6f2e943c425c7f8..72e4010157a9f0363f3c64a351e97ce879c5cd07 100644 |
| --- a/content/renderer/media/media_stream_audio_processor_unittest.cc |
| +++ b/content/renderer/media/media_stream_audio_processor_unittest.cc |
| @@ -11,6 +11,7 @@ |
| #include "content/public/common/content_switches.h" |
| #include "content/public/common/media_stream_request.h" |
| #include "content/renderer/media/media_stream_audio_processor.h" |
| +#include "content/renderer/media/mock_media_constraint_factory.h" |
| #include "media/audio/audio_parameters.h" |
| #include "media/base/audio_bus.h" |
| #include "testing/gmock/include/gmock/gmock.h" |
| @@ -227,4 +228,30 @@ TEST_F(MediaStreamAudioProcessorTest, VerifyTabCaptureWithoutAudioProcessing) { |
| audio_processor = NULL; |
| } |
| +TEST_F(MediaStreamAudioProcessorTest, TurnOffDefaultConstraints) { |
| + // Setup the audio processor with enabling the flag. |
|
phoglund_chromium
2014/03/11 14:43:21
Nit: Set up the audio processor with the flag enab
no longer working on chromium
2014/03/11 15:22:30
Done.
|
| + CommandLine::ForCurrentProcess()->AppendSwitch( |
| + switches::kEnableAudioTrackProcessing); |
| + |
| + // Turn off the default constraints and pass it to MediaStreamAudioProcessor. |
| + MockMediaConstraintFactory constraint_factory; |
| + constraint_factory.DisableDefaultAudioConstraints(); |
| + scoped_refptr<WebRtcAudioDeviceImpl> webrtc_audio_device( |
| + new WebRtcAudioDeviceImpl()); |
| + scoped_refptr<MediaStreamAudioProcessor> audio_processor( |
| + new talk_base::RefCountedObject<MediaStreamAudioProcessor>( |
| + constraint_factory.CreateWebMediaConstraints(), 0, |
| + MEDIA_DEVICE_AUDIO_CAPTURE, webrtc_audio_device.get())); |
| + EXPECT_FALSE(audio_processor->has_audio_processing()); |
| + audio_processor->OnCaptureFormatChanged(params_); |
| + |
| + ProcessDataAndVerifyFormat(audio_processor, |
| + params_.sample_rate(), |
| + params_.channels(), |
| + params_.sample_rate() / 100); |
| + // Set |audio_processor| to NULL to make sure |webrtc_audio_device| outlives |
| + // |audio_processor|. |
| + audio_processor = NULL; |
| +} |
| + |
| } // namespace content |