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

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

Issue 1780653002: Revert of MediaStream audio object graph untangling and clean-ups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/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();
}
}
« no previous file with comments | « content/renderer/media/speech_recognition_audio_sink.cc ('k') | content/renderer/media/track_audio_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698