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

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

Issue 12383016: Merge AssociateStreamWithProducer message into CreateStream message for both audio output and input. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 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 | Annotate | Revision Log
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 video_sources[0].setExtraData( 79 video_sources[0].setExtraData(
80 new MediaStreamSourceExtraData(info)); 80 new MediaStreamSourceExtraData(info));
81 } 81 }
82 WebKit::WebMediaStream stream_desc; 82 WebKit::WebMediaStream stream_desc;
83 stream_desc.initialize("media stream", audio_sources, video_sources); 83 stream_desc.initialize("media stream", audio_sources, video_sources);
84 84
85 return stream_desc; 85 return stream_desc;
86 } 86 }
87 87
88 void CreateNativeSources(WebKit::WebMediaStream* descriptor) { 88 void CreateNativeSources(WebKit::WebMediaStream* descriptor) {
89 static const int kRenderViewId = 1;
90
89 MediaSourceCreatedObserver observer; 91 MediaSourceCreatedObserver observer;
90 WebKit::WebMediaConstraints audio_constraints; 92 WebKit::WebMediaConstraints audio_constraints;
91 dependency_factory_->CreateNativeMediaSources( 93 dependency_factory_->CreateNativeMediaSources(
94 kRenderViewId,
92 WebKit::WebMediaConstraints(), 95 WebKit::WebMediaConstraints(),
93 WebKit::WebMediaConstraints(), 96 WebKit::WebMediaConstraints(),
94 descriptor, 97 descriptor,
95 base::Bind( 98 base::Bind(
96 &MediaSourceCreatedObserver::OnCreateNativeSourcesComplete, 99 &MediaSourceCreatedObserver::OnCreateNativeSourcesComplete,
97 base::Unretained(&observer))); 100 base::Unretained(&observer)));
98 101
99 EXPECT_FALSE(observer.result()); 102 EXPECT_FALSE(observer.result());
100 // Change the state of the created source to live. This should trigger 103 // Change the state of the created source to live. This should trigger
101 // MediaSourceCreatedObserver::OnCreateNativeSourcesComplete 104 // MediaSourceCreatedObserver::OnCreateNativeSourcesComplete
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 EXPECT_TRUE(dependency_factory_->RemoveNativeMediaStreamTrack( 185 EXPECT_TRUE(dependency_factory_->RemoveNativeMediaStreamTrack(
183 stream_desc, video_tracks[0])); 186 stream_desc, video_tracks[0]));
184 VerifyMediaStream(stream_desc, 1, 0); 187 VerifyMediaStream(stream_desc, 1, 0);
185 188
186 EXPECT_TRUE(dependency_factory_->AddNativeMediaStreamTrack( 189 EXPECT_TRUE(dependency_factory_->AddNativeMediaStreamTrack(
187 stream_desc, video_tracks[0])); 190 stream_desc, video_tracks[0]));
188 VerifyMediaStream(stream_desc, 1, 1); 191 VerifyMediaStream(stream_desc, 1, 1);
189 } 192 }
190 193
191 } // namespace content 194 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_dependency_factory.cc ('k') | content/renderer/media/media_stream_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698