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

Unified Diff: content/renderer/media/rtc_peer_connection_handler_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/rtc_peer_connection_handler_unittest.cc
diff --git a/content/renderer/media/rtc_peer_connection_handler_unittest.cc b/content/renderer/media/rtc_peer_connection_handler_unittest.cc
index f1ae3de47eb7bc9df75fd9e80fd0fdbd73d1a0c1..0ac11d6c7d5a31e9f15f52e3caceba61a3085594 100644
--- a/content/renderer/media/rtc_peer_connection_handler_unittest.cc
+++ b/content/renderer/media/rtc_peer_connection_handler_unittest.cc
@@ -20,6 +20,7 @@
#include "content/renderer/media/media_stream_source.h"
#include "content/renderer/media/media_stream_video_track.h"
#include "content/renderer/media/mock_data_channel_impl.h"
+#include "content/renderer/media/mock_media_constraint_factory.h"
#include "content/renderer/media/mock_media_stream_video_source.h"
#include "content/renderer/media/mock_peer_connection_impl.h"
#include "content/renderer/media/mock_web_rtc_peer_connection_handler_client.h"
@@ -267,10 +268,18 @@
blink::WebVector<blink::WebMediaStreamTrack> audio_tracks(
static_cast<size_t>(1));
audio_tracks[0].initialize(audio_source.id(), audio_source);
+ StreamDeviceInfo device_info(MEDIA_DEVICE_AUDIO_CAPTURE, "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,
+ nullptr, nullptr));
scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter(
WebRtcLocalAudioTrackAdapter::Create(audio_track_label, nullptr));
scoped_ptr<WebRtcLocalAudioTrack> native_track(
- new WebRtcLocalAudioTrack(adapter.get()));
+ new WebRtcLocalAudioTrack(adapter.get(), capturer, nullptr));
audio_tracks[0].setExtraData(native_track.release());
blink::WebVector<blink::WebMediaStreamTrack> video_tracks(
static_cast<size_t>(1));
@@ -512,7 +521,8 @@
blink::WebVector<blink::WebMediaStreamTrack> audio_tracks;
local_stream.audioTracks(audio_tracks);
MediaStreamAudioSource* native_audio_source =
- MediaStreamAudioSource::From(audio_tracks[0].source());
+ static_cast<MediaStreamAudioSource*>(
+ audio_tracks[0].source().getExtraData());
native_audio_source->StopSource();
blink::WebVector<blink::WebMediaStreamTrack> video_tracks;
« no previous file with comments | « content/renderer/media/rtc_peer_connection_handler.cc ('k') | content/renderer/media/speech_recognition_audio_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698