Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / dom / canvas / test / reftest / webgl-capturestream-test.html
blobefd343702e4c7a879d2c738902462090e0654f13
1 <!DOCTYPE html>
2 <meta charset='UTF-8'>
3 <!--
4 Clear the canvas to green and capture it to a stream to test that we can get
5 the stream to screen in a local video element.
6 -->
7 <html class="reftest-wait">
9 <head>
10 <script type='text/javascript' src='webgl-utils.js'></script>
11 <script type='text/javascript'>
12 'use strict';
14 function setStatus(text) {
15 var elem = document.getElementById('status');
16 elem.innerHTML = text;
19 function finished() {
20 document.documentElement.removeAttribute("class");
23 function runTest() {
24 var canvas = document.getElementById('canvas');
26 var gl = initGL(canvas);
27 if (!gl) {
28 setStatus('WebGL context creation failed.');
29 return;
32 gl.clearColor(0.0, 1.0, 0.0, 1.0);
33 gl.clear(gl.COLOR_BUFFER_BIT);
35 var video = document.getElementById('video');
36 video.srcObject = canvas.captureStream(0);
37 video.play();
38 video.onloadeddata = finished;
39 video.onerror = finished;
41 </script>
42 </head>
44 <body onload='runTest();'>
45 <video id='video' width='256' height='256'></video>
46 <canvas id='canvas' width='256' height='256' style="display:none"></canvas>
47 <div id='status'></div>
48 </body>
50 </html>