Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / dom / canvas / test / reftest / webgl-disable-test.html
blob30581ec2553f9e14009a728c744bb778121043a7
1 <!DOCTYPE html>
2 <html class="reftest-wait">
3 <head>
4 <meta charset="UTF-8">
6 <script type="text/javascript" src="webgl-utils.js"></script>
7 <script type="text/javascript">
8 /* Disable Test
10 * If we succeed in getting a WebGL context, we will fill
11 * the canvas with red. If we fail to acquire a WebGL context,
12 * we will use Canvas2D to instead fill it with green.
14 * Note that this test differs from the others in that
15 * it will draw differently if it receives a WebGL context.
16 * Other tests are designed to fallback silently to Canvas2D.
18 * We use this test to assure that when we disable WebGL,
19 * WebGL does not function. This is trivially true for systems
20 * that don't support WebGL. This test is not viable for testing
21 * that WebGL works, as blocklisted systems will always draw green.
24 "use strict";
26 function renderGL(gl) {
27 gl.clearColor(1.0, 0.0, 0.0, 1.0);
28 gl.clear(gl.COLOR_BUFFER_BIT);
29 gl.finish();
32 function renderBackup(canvas) {
33 var context = canvas.getContext("2d");
34 context.fillStyle = "rgba(0, 255, 0, 1.0)";
35 context.fillRect(0, 0, 256, 256);
38 function runTest() {
39 var canvas = document.getElementById("canvas");
40 var gl = initGL(canvas);
42 if (gl)
43 renderGL(gl);
44 else
45 renderBackup(canvas);
47 waitForComposite(testComplete);
50 function testComplete() {
51 document.documentElement.removeAttribute("class");
53 </script>
54 </head>
56 <body onload="rAF(runTest);">
57 <canvas id="canvas" width="256" height="256"></canvas>
58 </body>
60 </html>