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

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

Issue 139303016: Feed the render data to MediaStreamAudioProcessor and used AudioBus in render callback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the unittests, ready for review now. Created 6 years, 11 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/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 a890d1d43bfdf5f8b9ef9498610c7c50617f6ec6..6b3f427231da5a3e69a6511417427d6b39ba103f 100644
--- a/content/renderer/media/media_stream_audio_processor_unittest.cc
+++ b/content/renderer/media/media_stream_audio_processor_unittest.cc
@@ -80,10 +80,10 @@ class MediaStreamAudioProcessorTest : public ::testing::Test {
// |audio_processor| does nothing when the audio processing is off in
// the processor.
- audio_processor->PushRenderData(
- data_ptr,
- params_.sample_rate(), params_.channels(),
- params_.frames_per_buffer(), base::TimeDelta::FromMilliseconds(10));
+ if (audio_processor->has_audio_processing()) {
+ static_cast<WebRtcAudioRendererSource*>(audio_processor)->RenderData(
+ data_bus.get(), params_.sample_rate(), 10);
+ }
int16* output = NULL;
while(audio_processor->ProcessAndConsumeData(
@@ -108,7 +108,7 @@ TEST_F(MediaStreamAudioProcessorTest, WithoutAudioProcessing) {
// Setup the audio processor without enabling the flag.
blink::WebMediaConstraints constraints;
scoped_refptr<MediaStreamAudioProcessor> audio_processor(
- new MediaStreamAudioProcessor(params_, constraints, 0));
+ new MediaStreamAudioProcessor(params_, constraints, 0, NULL));
EXPECT_FALSE(audio_processor->has_audio_processing());
ProcessDataAndVerifyFormat(audio_processor,
@@ -123,7 +123,7 @@ TEST_F(MediaStreamAudioProcessorTest, WithAudioProcessing) {
switches::kEnableAudioTrackProcessing);
blink::WebMediaConstraints constraints;
scoped_refptr<MediaStreamAudioProcessor> audio_processor(
- new MediaStreamAudioProcessor(params_, constraints, 0));
+ new MediaStreamAudioProcessor(params_, constraints, 0, NULL));
EXPECT_TRUE(audio_processor->has_audio_processing());
ProcessDataAndVerifyFormat(audio_processor,

Powered by Google App Engine
This is Rietveld 408576698