Bug 1935611 - Fix libyuv/libpng link failed for loongarch64. r=glandium,tnikkel,ng
[gecko.git] / dom / canvas / test / test_imagebitmap_structuredclone_iframe.html
blobc0b2b894ad81c468845f81338fa1c95ae8e735c3
1 <!DOCTYPE HTML>
2 <title>Test ImageBitmap : StructuredClone between main window and iframe</title>
3 <meta charset="utf-8">
4 <script src="/tests/SimpleTest/SimpleTest.js"></script>
5 <link rel="stylesheet" href="/tests/SimpleTest/test.css">
6 <body>
7 <div id="content"></div>
8 <script src="imagebitmap_structuredclone_utils.js"></script>
9 <script type="text/javascript">
11 function runTests() {
12 window.onmessage = function(event) {
13 if (event.data.type == "status") {
14 ok(event.data.status, event.data.msg);
15 } else if (event.data.type == "finish") {
16 SimpleTest.finish();
17 } else if (event.data.type == "bitmap1") {
18 compareImageBitmapWithImageElement(event.data.bitmap, gImage1);
19 } else if (event.data.type == "bitmap2") {
20 compareImageBitmapWithImageElement(event.data.bitmap, gImage2);
21 } else if (event.data.type == "bitmap3") {
22 compareImageBitmapWithImageData(event.data.bitmap, gImageData, "Check preserving alpha");
26 var div = document.getElementById("content");
27 ok(div, "Parent exists");
29 var ifr = document.createElement("iframe");
30 ifr.addEventListener("load", iframeLoaded);
31 ifr.setAttribute('src', "imagebitmap_structuredclone_iframe.html");
32 div.appendChild(ifr);
34 function iframeLoaded() {
35 prepareImageBitmaps().then(function(){
36 ifr.contentWindow.postMessage({"bitmap1":gImageBitmap1, "bitmap2":gImageBitmap2, "bitmap3":gImageBitmap3}, "*");
37 });
41 SimpleTest.waitForExplicitFinish();
42 addLoadEvent(runTests);
44 </script>
45 </body>