summaryrefslogtreecommitdiffstats
path: root/dom/media/webrtc/tests/mochitests/test_getUserMedia_gumWithinGum.html
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/webrtc/tests/mochitests/test_getUserMedia_gumWithinGum.html')
-rw-r--r--dom/media/webrtc/tests/mochitests/test_getUserMedia_gumWithinGum.html38
1 files changed, 38 insertions, 0 deletions
diff --git a/dom/media/webrtc/tests/mochitests/test_getUserMedia_gumWithinGum.html b/dom/media/webrtc/tests/mochitests/test_getUserMedia_gumWithinGum.html
new file mode 100644
index 0000000000..86a7aa5606
--- /dev/null
+++ b/dom/media/webrtc/tests/mochitests/test_getUserMedia_gumWithinGum.html
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <script type="application/javascript" src="mediaStreamPlayback.js"></script>
+</head>
+<body>
+<pre id="test">
+<script type="application/javascript">
+ createHTML({title: "getUserMedia within getUserMedia", bug: "822109" });
+ /**
+ * Run a test that we can complete a playback cycle for a video,
+ * then upon completion, do a playback cycle with audio, such that
+ * the audio gum call happens within the video gum call.
+ */
+ runTest(function () {
+ return getUserMedia({video: true})
+ .then(videoStream => {
+ var testVideo = createMediaElement('video', 'testVideo');
+ var videoPlayback = new MediaStreamPlayback(testVideo,
+ videoStream);
+
+ return videoPlayback.playMediaWithoutStoppingTracks(false)
+ .then(() => getUserMedia({audio: true}))
+ .then(audioStream => {
+ var testAudio = createMediaElement('audio', 'testAudio');
+ var audioPlayback = new MediaStreamPlayback(testAudio,
+ audioStream);
+
+ return audioPlayback.playMedia(false);
+ })
+ .then(() => videoStream.getTracks().forEach(t => t.stop()));
+ });
+ });
+
+</script>
+</pre>
+</body>
+</html>