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

Side by Side Diff: content/renderer/media/media_stream_dependency_factory_unittest.cc

Issue 23731007: Implicit audio output device selection for getUserMedia. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 7 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "content/common/media/media_stream_options.h" 6 #include "content/common/media/media_stream_options.h"
7 #include "content/renderer/media/media_stream_extra_data.h" 7 #include "content/renderer/media/media_stream_extra_data.h"
8 #include "content/renderer/media/media_stream_source_extra_data.h" 8 #include "content/renderer/media/media_stream_source_extra_data.h"
9 #include "content/renderer/media/mock_media_stream_dependency_factory.h" 9 #include "content/renderer/media/mock_media_stream_dependency_factory.h"
10 #include "content/renderer/media/mock_web_rtc_peer_connection_handler_client.h" 10 #include "content/renderer/media/mock_web_rtc_peer_connection_handler_client.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 WebKit::WebMediaStream CreateWebKitMediaStream(bool audio, bool video) { 62 WebKit::WebMediaStream CreateWebKitMediaStream(bool audio, bool video) {
63 WebKit::WebVector<WebKit::WebMediaStreamSource> audio_sources( 63 WebKit::WebVector<WebKit::WebMediaStreamSource> audio_sources(
64 audio ? static_cast<size_t>(1) : 0); 64 audio ? static_cast<size_t>(1) : 0);
65 WebKit::WebVector<WebKit::WebMediaStreamSource> video_sources( 65 WebKit::WebVector<WebKit::WebMediaStreamSource> video_sources(
66 video ? static_cast<size_t>(1) : 0); 66 video ? static_cast<size_t>(1) : 0);
67 67
68 if (audio) { 68 if (audio) {
69 StreamDeviceInfo info; 69 StreamDeviceInfo info;
70 info.device.type = content::MEDIA_DEVICE_AUDIO_CAPTURE; 70 info.device.type = content::MEDIA_DEVICE_AUDIO_CAPTURE;
71 info.device.name = "audio"; 71 info.device.name = "audio";
72 info.device.sample_rate = 0;
73 info.device.channel_layout = 0;
74 info.session_id = 99; 72 info.session_id = 99;
75 audio_sources[0].initialize("audio", 73 audio_sources[0].initialize("audio",
76 WebKit::WebMediaStreamSource::TypeAudio, 74 WebKit::WebMediaStreamSource::TypeAudio,
77 "audio"); 75 "audio");
78 audio_sources[0].setExtraData( 76 audio_sources[0].setExtraData(
79 new MediaStreamSourceExtraData(info, audio_sources[0])); 77 new MediaStreamSourceExtraData(info, audio_sources[0]));
80 audio_sources_.assign(audio_sources); 78 audio_sources_.assign(audio_sources);
81 } 79 }
82 if (video) { 80 if (video) {
83 StreamDeviceInfo info; 81 StreamDeviceInfo info;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 EXPECT_TRUE(dependency_factory_->RemoveNativeMediaStreamTrack( 217 EXPECT_TRUE(dependency_factory_->RemoveNativeMediaStreamTrack(
220 stream_desc, video_tracks[0])); 218 stream_desc, video_tracks[0]));
221 VerifyMediaStream(stream_desc, 1, 0); 219 VerifyMediaStream(stream_desc, 1, 0);
222 220
223 EXPECT_TRUE(dependency_factory_->AddNativeMediaStreamTrack( 221 EXPECT_TRUE(dependency_factory_->AddNativeMediaStreamTrack(
224 stream_desc, video_tracks[0])); 222 stream_desc, video_tracks[0]));
225 VerifyMediaStream(stream_desc, 1, 1); 223 VerifyMediaStream(stream_desc, 1, 1);
226 } 224 }
227 225
228 } // namespace content 226 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_dependency_factory.cc ('k') | content/renderer/media/media_stream_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698