gecko-dev/dom/media/tests/mochitest/test_getUserMedia_playAudioTwice.html
Nils Ohlmeier [:drno] 550f159197 Bug 1161615 - Clean up gUM mochitest to use promises. r=mt
--HG--
extra : transplant_source : %E1%81%12%9A%0D%C0%A6%DF%21%84o%06%7E1%40%1E%93%97%2Ag
2015-05-12 10:51:46 -07:00

27 lines
738 B
HTML

<!DOCTYPE HTML>
<html>
<head>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
createHTML({title: "getUserMedia Play Audio Twice", bug: "822109" });
/**
* Run a test that we can complete an audio playback cycle twice in a row.
*/
runTest(function () {
return getUserMedia({audio: true}).then(audioStream => {
var testAudio = createMediaElement('audio', 'testAudio');
var playback = new LocalMediaStreamPlayback(testAudio, audioStream);
return playback.playMedia(false)
.then(() => playback.playMedia(true))
.then(() => audioStream.stop());
});
});
</script>
</pre>
</body>
</html>