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

Side by Side Diff: content/test/data/media/getusermedia.html

Issue 1073783003: Add tests for closing a frame within the scope of a getusermedia callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script type="text/javascript" src="webrtc_test_utilities.js"></script> 3 <script type="text/javascript" src="webrtc_test_utilities.js"></script>
4 <script type="text/javascript"> 4 <script type="text/javascript">
5 $ = function(id) { 5 $ = function(id) {
6 return document.getElementById(id); 6 return document.getElementById(id);
7 }; 7 };
8 8
9 setAllEventsOccuredHandler(function() { 9 setAllEventsOccuredHandler(function() {
10 reportTestSuccess(); 10 reportTestSuccess();
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 'local-view-2', 274 'local-view-2',
275 function() { 275 function() {
276 validateFrameRate('local-view-2', expected_frame_rate2, 276 validateFrameRate('local-view-2', expected_frame_rate2,
277 validateFrameRateCallback); 277 validateFrameRateCallback);
278 }); 278 });
279 }, 279 },
280 failedCallback); 280 failedCallback);
281 } 281 }
282 } 282 }
283 283
284 function getUserMediaInIframeAndCloseInSuccessCb(constraints) {
285 var iframe = document.createElement('iframe');
286 iframe.onload = onIframeLoaded;
287 document.body.appendChild(iframe);
288 iframe.src = window.location;
289
290 function onIframeLoaded() {
291 var iframe = window.document.querySelector('iframe');
292 iframe.contentWindow.navigator.webkitGetUserMedia(
293 constraints,
294 function (stream) {
295 console.log("getUserMedia succeeded.");
phoglund_chromium 2015/04/10 09:47:58 Remove.
perkj_chrome 2015/04/10 09:57:29 Done.
296 // Remove the iframe from the parent within the callback scope.
297 window.parent.document.querySelector('iframe').remove();
298 window.parent.reportTestSuccess();
299 },
300 window.parent.failedCallback);
301 }
302 }
303
304 function getUserMediaInIframeAndCloseInFailureCb(constraints) {
305 var iframe = document.createElement('iframe');
306 iframe.onload = onIframeLoaded;
307 document.body.appendChild(iframe);
308 iframe.src = window.location;
309
310 function onIframeLoaded() {
311 var iframe = window.document.querySelector('iframe');
312 iframe.contentWindow.navigator.webkitGetUserMedia(
313 constraints,
314 function (stream) {
315 window.parent.failTest('GetUserMedia call succeeded unexpectedly.');
316 },
317 function (error) {
318 console.log("getUserMedia failed.");
phoglund_chromium 2015/04/10 09:47:58 Remove.
perkj_chrome 2015/04/10 09:57:29 Done.
319 // Remove the iframe from the parent within the callback scope.
320 window.parent.document.querySelector('iframe').remove();
321 window.parent.reportTestSuccess();
322 });
323 }
324 }
325
284 function failedCallback(error) { 326 function failedCallback(error) {
285 failTest('GetUserMedia call failed with code ' + error.code); 327 failTest('GetUserMedia call failed with code ' + error.code);
286 } 328 }
287 329
288 function attachMediaStream(stream, videoElement) { 330 function attachMediaStream(stream, videoElement) {
289 var localStreamUrl = URL.createObjectURL(stream); 331 var localStreamUrl = URL.createObjectURL(stream);
290 $(videoElement).src = localStreamUrl; 332 $(videoElement).src = localStreamUrl;
291 } 333 }
292 334
293 function detectVideoInLocalView1(stream, callback) { 335 function detectVideoInLocalView1(stream, callback) {
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 </tr> 514 </tr>
473 <tr> 515 <tr>
474 <td><video id="local-view-2" width="320" height="240" autoplay 516 <td><video id="local-view-2" width="320" height="240" autoplay
475 style="display:none"></video></td> 517 style="display:none"></video></td>
476 <td><canvas id="local-view-2-canvas" width="320" height="240" 518 <td><canvas id="local-view-2-canvas" width="320" height="240"
477 style="display:none"></canvas></td> 519 style="display:none"></canvas></td>
478 </tr> 520 </tr>
479 </table> 521 </table>
480 </body> 522 </body>
481 </html> 523 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698