1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/media/tests/mochitest/test_getUserMedia_stopVideoAudioStreamWithFollowupVideoAudio.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,52 @@ 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+Audio Stream With Followup Video+Audio</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+Audio Stream With Followup Video+Audio</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 video+audio gum playback in a 1.28 + * media element, stop the stream, and then complete another video+audio gum 1.29 + * playback in a media element. 1.30 + */ 1.31 + runTest(function () { 1.32 + getUserMedia({video: true, audio: true}, function(firstStream) { 1.33 + var testVideo = document.getElementById('testVideo'); 1.34 + var streamPlayback = new LocalMediaStreamPlayback(testVideo, firstStream); 1.35 + 1.36 + streamPlayback.playMediaWithStreamStop(false, function() { 1.37 + getUserMedia({video: true, audio: true}, function(secondStream) { 1.38 + streamPlayback.mediaStream = secondStream; 1.39 + 1.40 + streamPlayback.playMedia(false, function() { 1.41 + secondStream.stop(); 1.42 + SimpleTest.finish(); 1.43 + }, generateErrorCallback()); 1.44 + 1.45 + }, generateErrorCallback()); 1.46 + 1.47 + }, generateErrorCallback()); 1.48 + 1.49 + }, generateErrorCallback()); 1.50 + }); 1.51 + 1.52 +</script> 1.53 +</pre> 1.54 +</body> 1.55 +</html>