Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / dom / canvas / test / webgl-mochitest / test_webgl_force_enable.html
blob8e8b05e6d3e1d5334dc8f0a11225fbf3865b9a40
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>WebGL test: Check that WebGL works (or not) if it should (or should not).</title>
5 <script src="/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" href="/tests/SimpleTest/test.css">
7 <script src="driver-info.js"></script>
8 </head>
9 <body>
10 <canvas id="c"></canvas>
11 <script>
13 function test() {
14 ok(SpecialPowers.getBoolPref('webgl.force-enabled'), 'WebGL should be force-enabled.');
16 var shouldSucceed = true;
17 var shouldFail = false;
19 if (DriverInfo.getOS() == DriverInfo.OS.ANDROID &&
20 DriverInfo.getOSVersion() < 15)
22 // Consider 'random'. Actually, ARMv6 fails, and ARMv7 succeeds, but we have
23 // not been successful at determining this from JS. (see bug 917478)
24 shouldSucceed = false;
25 shouldFail = false;
28 var gl = c.getContext('webgl');
29 if (shouldSucceed) {
30 ok(gl, 'Expected WebGL creation to succeed.');
32 if (shouldFail) {
33 ok(!gl, 'Expected WebGL creation to fail.');
36 SimpleTest.finish();
39 SimpleTest.waitForExplicitFinish();
41 var prefArrArr = [
42 ['webgl.force-enabled', true]
44 var prefEnv = {'set': prefArrArr};
45 SpecialPowers.pushPrefEnv(prefEnv, test);
47 </script>
48 </body>
49 </html>