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

Side by Side Diff: components/test_runner/mock_web_user_media_client.cc

Issue 1543673002: MediaRecorder: make MediaRecorderHandler a MediaStreamObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added content_browsertests for Error Event firing when Track added/removed to MS Created 4 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/test_runner/mock_web_user_media_client.h" 5 #include "components/test_runner/mock_web_user_media_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 if (!constraints.isNull() && 158 if (!constraints.isNull() &&
159 !MockConstraints::VerifyConstraints(constraints, &failed_constraint)) { 159 !MockConstraints::VerifyConstraints(constraints, &failed_constraint)) {
160 delegate_->PostTask(new UserMediaRequestConstraintFailedTask( 160 delegate_->PostTask(new UserMediaRequestConstraintFailedTask(
161 this, request, failed_constraint)); 161 this, request, failed_constraint));
162 return; 162 return;
163 } 163 }
164 164
165 WebMediaStream stream; 165 WebMediaStream stream;
166 stream.initialize(WebVector<WebMediaStreamTrack>(), 166 stream.initialize(WebVector<WebMediaStreamTrack>(),
167 WebVector<WebMediaStreamTrack>()); 167 WebVector<WebMediaStreamTrack>());
168 stream.setExtraData(new MockExtraData()); 168 delegate_->AddMediaStream(&stream);
169 169
170 if (request.audio() && 170 if (request.audio() &&
171 !delegate_->AddMediaStreamAudioSourceAndTrack(&stream)) { 171 !delegate_->AddMediaStreamAudioSourceAndTrack(&stream)) {
172 WebMediaStreamSource source; 172 WebMediaStreamSource source;
173 source.initialize("MockAudioDevice#1", 173 source.initialize("MockAudioDevice#1",
174 WebMediaStreamSource::TypeAudio, 174 WebMediaStreamSource::TypeAudio,
175 "Mock audio device", 175 "Mock audio device",
176 false /* remote */, 176 false /* remote */,
177 true /* readonly */); 177 true /* readonly */);
178 WebMediaStreamTrack web_track; 178 WebMediaStreamTrack web_track;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 sources[i].initialize(WebString::fromUTF8(test_sources[i].id), 269 sources[i].initialize(WebString::fromUTF8(test_sources[i].id),
270 test_sources[i].kind, 270 test_sources[i].kind,
271 WebString::fromUTF8(test_sources[i].label), 271 WebString::fromUTF8(test_sources[i].label),
272 test_sources[i].facing); 272 test_sources[i].facing);
273 } 273 }
274 274
275 delegate_->PostTask(new SourcesRequestTask(this, request, sources)); 275 delegate_->PostTask(new SourcesRequestTask(this, request, sources));
276 } 276 }
277 277
278 } // namespace test_runner 278 } // namespace test_runner
OLDNEW
« no previous file with comments | « components/html_viewer/web_test_delegate_impl.cc ('k') | components/test_runner/web_test_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698