Bug 1935611 - Fix libyuv/libpng link failed for loongarch64. r=glandium,tnikkel,ng
[gecko.git] / dom / canvas / test / imagebitmap_structuredclone_iframe.html
blob7628b49dae7efeea56f51cc81adc54d34eed0860
1 <!DOCTYPE HTML>
2 <meta charset="utf-8">
3 <body>
4 <script type="application/javascript">
6 function ok(expect, msg) {
7 window.parent.postMessage({"type": "status", status: !!expect, msg}, "*");
10 window.onmessage = function(event) {
11 ok(!!event.data.bitmap1, "Get the 1st ImageBitmap from the main script.");
12 ok(!!event.data.bitmap2, "Get the 2st ImageBitmap from the main script.");
14 // send the first original ImageBitmap back to the main window
15 window.parent.postMessage({"type":"bitmap1", "bitmap":event.data.bitmap1}, "*");
17 // create a new ImageBitmap from the 2nd original ImageBitmap
18 // and then send the newly created ImageBitmap back to the main window
19 var promise = createImageBitmap(event.data.bitmap2);
20 promise.then(
21 function(bitmap) {
22 ok(true, "Successfully create a new ImageBitmap from the 2nd original bitmap in worker.");
24 // send the newly created ImageBitmap back to the main window
25 window.parent.postMessage({"type":"bitmap2", "bitmap":bitmap}, "*");
27 // finish the test
28 window.parent.postMessage({"type": "finish"}, "*");
30 function() {
31 ok(false, "Cannot create a new bitmap from the original bitmap in worker.");
37 </script>
38 </body>