4 <title>WebGL in OffscreenCanvas
</title>
5 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel=
"stylesheet" href=
"/tests/SimpleTest/test.css">
11 SimpleTest
.waitForExplicitFinish();
16 window
.onmessage = function(evt
) {
17 var msg
= evt
.data
|| {};
18 if (msg
.type
== "test") {
19 ok(msg
.result
, msg
.name
);
21 if (msg
.type
== "finish") {
22 registration
.unregister().then(function() {
28 navigator
.serviceWorker
.register('offscreencanvas.js', { scope
: "."})
29 // Wait until the service worker is active.
32 return navigator
.serviceWorker
.ready
;
34 // ...and then show the interface for the commands once it's ready.
36 iframe
= document
.createElement("iframe");
37 iframe
.setAttribute('src', "offscreencanvas_serviceworker_inner.html");
38 document
.body
.appendChild(iframe
);
42 SpecialPowers
.pushPrefEnv({'set': [
43 ['webgl.force-enabled', true],
44 ["dom.serviceWorkers.exemptFromPerDomainMax", true],
45 ["dom.serviceWorkers.enabled", true],
46 ["dom.serviceWorkers.testing.enabled", true]