1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/media/tests/mochitest/test_getUserMedia_stopVideoStreamWithFollowupVideo.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,53 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=822109 1.8 +--> 1.9 +<head> 1.10 + <meta charset="utf-8"> 1.11 + <title>mozGetUserMedia Stop Video Stream With Followup Video</title> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.13 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.14 + <script type="application/javascript" src="head.js"></script> 1.15 + <script type="application/javascript" src="mediaStreamPlayback.js"></script> 1.16 +</head> 1.17 +<body> 1.18 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=822109">mozGetUserMedia Stop Video Stream With Followup Video</a> 1.19 +<p id="display"></p> 1.20 +<div id="content" style="display: none"> 1.21 + <video id="testVideo"></video> 1.22 +</div> 1.23 +<pre id="test"> 1.24 +<script type="application/javascript"> 1.25 + 1.26 + /** 1.27 + * Run a test to verify that I can complete an audio gum playback in a media 1.28 + * element, stop the stream, and then complete another audio gum playback 1.29 + * in a media element. 1.30 + */ 1.31 + runTest(function () { 1.32 + getUserMedia({video: true}, function(firstStream) { 1.33 + var testVideo = document.getElementById('testVideo'); 1.34 + var streamPlayback = new LocalMediaStreamPlayback(testVideo, 1.35 + firstStream); 1.36 + 1.37 + streamPlayback.playMediaWithStreamStop(false, function() { 1.38 + getUserMedia({video: true}, function(secondStream) { 1.39 + streamPlayback.mediaStream = secondStream; 1.40 + 1.41 + streamPlayback.playMedia(false, function() { 1.42 + secondStream.stop(); 1.43 + SimpleTest.finish(); 1.44 + }, generateErrorCallback()); 1.45 + 1.46 + }, generateErrorCallback()); 1.47 + 1.48 + }, generateErrorCallback()); 1.49 + 1.50 + }, generateErrorCallback()); 1.51 + }); 1.52 + 1.53 +</script> 1.54 +</pre> 1.55 +</body> 1.56 +</html>