Bug 1935611 - Fix libyuv/libpng link failed for loongarch64. r=glandium,tnikkel,ng
[gecko.git] / dom / canvas / test / test_offscreencanvas_serviceworker.html
blob40897fe81a3c73e69801ea40b69ccdf7cfbf45a8
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>WebGL in OffscreenCanvas</title>
5 <script src="/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" href="/tests/SimpleTest/test.css">
7 </head>
8 <body>
9 <script>
11 SimpleTest.waitForExplicitFinish();
13 function runTest() {
14 var registration;
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() {
23 SimpleTest.finish();
24 });
28 navigator.serviceWorker.register('offscreencanvas.js', { scope: "."})
29 // Wait until the service worker is active.
30 .then(function(swr) {
31 registration = swr;
32 return navigator.serviceWorker.ready;
34 // ...and then show the interface for the commands once it's ready.
35 .then(function() {
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]
47 ]}, runTest);
49 </script>
50 </body>
51 </html>