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

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: Created 4 years, 12 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 "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "components/test_runner/mock_constraints.h" 9 #include "components/test_runner/mock_constraints.h"
10 #include "components/test_runner/web_test_delegate.h" 10 #include "components/test_runner/web_test_delegate.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 if (!constraints.isNull() && 156 if (!constraints.isNull() &&
157 !MockConstraints::VerifyConstraints(constraints, &failed_constraint)) { 157 !MockConstraints::VerifyConstraints(constraints, &failed_constraint)) {
158 delegate_->PostTask(new UserMediaRequestConstraintFailedTask( 158 delegate_->PostTask(new UserMediaRequestConstraintFailedTask(
159 this, request, failed_constraint)); 159 this, request, failed_constraint));
160 return; 160 return;
161 } 161 }
162 162
163 WebMediaStream stream; 163 WebMediaStream stream;
164 stream.initialize(WebVector<WebMediaStreamTrack>(), 164 stream.initialize(WebVector<WebMediaStreamTrack>(),
165 WebVector<WebMediaStreamTrack>()); 165 WebVector<WebMediaStreamTrack>());
166 stream.setExtraData(new MockExtraData()); 166 delegate_->AddMediaStream(&stream);
perkj_chrome 2016/01/07 09:18:00 this seems wrong. Why not just do stream.setExtraD
mcasas 2016/01/08 00:14:12 The gist of this is that test_runner cannot depend
perkj_chrome 2016/01/08 07:54:50 I see. So MockWebUserMediaClient does not actually
167 167
168 if (request.audio() && 168 if (request.audio() &&
169 !delegate_->AddMediaStreamAudioSourceAndTrack(&stream)) { 169 !delegate_->AddMediaStreamAudioSourceAndTrack(&stream)) {
170 WebMediaStreamSource source; 170 WebMediaStreamSource source;
171 source.initialize("MockAudioDevice#1", 171 source.initialize("MockAudioDevice#1",
172 WebMediaStreamSource::TypeAudio, 172 WebMediaStreamSource::TypeAudio,
173 "Mock audio device", 173 "Mock audio device",
174 false /* remote */, 174 false /* remote */,
175 true /* readonly */); 175 true /* readonly */);
176 WebMediaStreamTrack web_track; 176 WebMediaStreamTrack web_track;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 sources[i].initialize(WebString::fromUTF8(test_sources[i].id), 267 sources[i].initialize(WebString::fromUTF8(test_sources[i].id),
268 test_sources[i].kind, 268 test_sources[i].kind,
269 WebString::fromUTF8(test_sources[i].label), 269 WebString::fromUTF8(test_sources[i].label),
270 test_sources[i].facing); 270 test_sources[i].facing);
271 } 271 }
272 272
273 delegate_->PostTask(new SourcesRequestTask(this, request, sources)); 273 delegate_->PostTask(new SourcesRequestTask(this, request, sources));
274 } 274 }
275 275
276 } // namespace test_runner 276 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698