4 <title>WebGL in OffscreenCanvas
</title>
5 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel=
"stylesheet" href=
"/tests/SimpleTest/test.css">
9 <canvas id=
"c" width=
"64" height=
"64"></canvas>
12 SimpleTest
.waitForExplicitFinish();
16 var htmlCanvas
= document
.getElementById("c");
17 var worker
= new Worker("offscreencanvas.js");
19 worker
.onmessage = function(evt
) {
20 var msg
= evt
.data
|| {};
21 if (msg
.type
== "test") {
22 ok(msg
.result
, msg
.name
);
24 if (msg
.type
== "finish") {
30 var offscreenCanvas
= htmlCanvas
.transferControlToOffscreen();
31 worker
.postMessage({test
: 'webgl_changesize', canvas
: offscreenCanvas
}, [offscreenCanvas
]);
34 SpecialPowers
.pushPrefEnv({'set': [
35 ['webgl.force-enabled', true],