Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / dom / canvas / test / webgl-mochitest / test_webgl_request_context.html
blobd11584e08ccc8d44e8a7f7c518c8eff32f88102e
1 <!DOCTYPE HTML>
2 <title>WebGL test: 'webgl' and 'experimental-webgl' context requests succeed,
3 'moz-webgl' context requests fail.</title>
4 <script src="/tests/SimpleTest/SimpleTest.js"></script>
5 <link rel="stylesheet" href="/tests/SimpleTest/test.css">
6 <script src="driver-info.js"></script>
7 <body>
8 <canvas id="c1"></canvas>
9 <canvas id="c2"></canvas>
10 <script>
12 var testFunc = ok;
14 function testContextRetrieval(canvasId, creationId, shouldSucceed) {
15 var canvas = document.getElementById(canvasId);
16 ok(canvas, 'Invalid `canvasId`: ' + canvasId);
18 var createdGL = canvas.getContext(creationId);
19 if (shouldSucceed) {
20 testFunc(createdGL, 'Request for \'' + creationId + '\' should succeed.');
21 } else {
22 ok(!createdGL, 'Request for \'' + creationId + '\' should fail.');
26 SimpleTest.waitForExplicitFinish();
27 SpecialPowers.pushPrefEnv({'set': [
28 ['webgl.force-enabled', true]
29 ]}, function() {
30 testContextRetrieval('c1', 'experimental-webgl', true);
31 testContextRetrieval('c2', 'moz-webgl', false);
32 SimpleTest.finish();
33 });
35 </script>