Bug 1935611 - Fix libyuv/libpng link failed for loongarch64. r=glandium,tnikkel,ng
[gecko.git] / dom / canvas / test / test_offscreencanvas_sharedworker.html
blobd774ab8dae3370983642341aeec3e005e6c41bf9
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 <canvas id="c" width="64" height="64"></canvas>
10 <script>
12 SimpleTest.waitForExplicitFinish();
14 function runTest() {
16 var htmlCanvas = document.getElementById("c");
17 var worker = new SharedWorker("offscreencanvas.js");
19 ok(htmlCanvas, "Should have HTML canvas element");
20 ok(worker, "Web worker successfully created");
22 ok(htmlCanvas.transferControlToOffscreen, "HTMLCanvasElement has transferControlToOffscreen function");
24 var offscreenCanvas = htmlCanvas.transferControlToOffscreen();
25 ok(offscreenCanvas, "Expected transferControlToOffscreen to succeed");
27 worker.port.start();
29 // We don't support transferring OffscreenCanvas via shared worker.
30 SimpleTest.doesThrow(
31 function() {
32 worker.port.postMessage({test: 'webgl', canvas: offscreenCanvas}, [offscreenCanvas]);
34 "OffscreenCanvas cannot transfer to shared worker"
37 SimpleTest.finish();
40 SpecialPowers.pushPrefEnv({'set': [
41 ['webgl.force-enabled', true],
42 ]}, runTest);
44 </script>
45 </body>
46 </html>