Index: content/renderer/media/speech_recognition_audio_sink_unittest.cc |
diff --git a/content/renderer/media/speech_recognition_audio_sink_unittest.cc b/content/renderer/media/speech_recognition_audio_sink_unittest.cc |
index 26256b4f940523adeb8943bbd2b72281b7f5a068..64ee4348f10d53570d6f09f0271141479d168596 100644 |
--- a/content/renderer/media/speech_recognition_audio_sink_unittest.cc |
+++ b/content/renderer/media/speech_recognition_audio_sink_unittest.cc |
@@ -13,6 +13,7 @@ |
#include "base/macros.h" |
#include "base/strings/utf_string_conversions.h" |
#include "content/renderer/media/media_stream_audio_source.h" |
+#include "content/renderer/media/mock_media_constraint_factory.h" |
#include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" |
#include "content/renderer/media/webrtc_local_audio_track.h" |
#include "media/audio/audio_parameters.h" |
@@ -274,19 +275,26 @@ |
static void PrepareBlinkTrackOfType( |
const MediaStreamType device_type, |
blink::WebMediaStreamTrack* blink_track) { |
+ StreamDeviceInfo device_info(device_type, "Mock device", |
+ "mock_device_id"); |
+ MockMediaConstraintFactory constraint_factory; |
+ const blink::WebMediaConstraints constraints = |
+ constraint_factory.CreateWebMediaConstraints(); |
+ scoped_refptr<WebRtcAudioCapturer> capturer( |
+ WebRtcAudioCapturer::CreateCapturer(-1, device_info, constraints, NULL, |
+ NULL)); |
scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter( |
WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL)); |
scoped_ptr<WebRtcLocalAudioTrack> native_track( |
- new WebRtcLocalAudioTrack(adapter.get())); |
+ new WebRtcLocalAudioTrack(adapter.get(), capturer, NULL)); |
blink::WebMediaStreamSource blink_audio_source; |
blink_audio_source.initialize(base::UTF8ToUTF16("dummy_source_id"), |
blink::WebMediaStreamSource::TypeAudio, |
base::UTF8ToUTF16("dummy_source_name"), |
false /* remote */, true /* readonly */); |
MediaStreamSource::SourceStoppedCallback cb; |
- blink_audio_source.setExtraData(new MediaStreamAudioSource( |
- -1, StreamDeviceInfo(device_type, "Mock device", "mock_device_id"), cb, |
- nullptr)); |
+ blink_audio_source.setExtraData( |
+ new MediaStreamAudioSource(-1, device_info, cb, NULL)); |
blink_track->initialize(blink::WebString::fromUTF8("dummy_track"), |
blink_audio_source); |
blink_track->setExtraData(native_track.release()); |
@@ -298,7 +306,7 @@ |
const base::TimeTicks estimated_capture_time = first_frame_capture_time_ + |
(sample_frames_captured_ * base::TimeDelta::FromSeconds(1) / |
source_params_.sample_rate()); |
- native_track()->Capture(*source_bus_, estimated_capture_time); |
+ native_track()->Capture(*source_bus_, estimated_capture_time, false); |
sample_frames_captured_ += source_bus_->frames(); |
} |
} |