Bug 1935611 - Fix libyuv/libpng link failed for loongarch64. r=glandium,tnikkel,ng
[gecko.git] / dom / canvas / test / test_imagebitmap_transfer.html
blob99eee5dcd86b53af47b17d709ec6deb570ee0a6a
1 <!DOCTYPE HTML>
2 <title>Test ImageBitmap : Transfer</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 <script src="imagebitmap_structuredclone_utils.js"></script>
8 <script type="text/javascript">
10 var worker = new Worker("imagebitmap_structuredclone.js");
11 worker.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 function runTests() {
27 ok(worker, "Worker created successfully.");
29 prepareImageBitmaps().then(function(){
30 worker.postMessage({"bitmap1":gImageBitmap1, "bitmap2":gImageBitmap2, "bitmap3":gImageBitmap3},
31 [gImageBitmap1, gImageBitmap2, gImageBitmap3]);
33 ok(gImageBitmap1.width == 0 && gImageBitmap1.height == 0,
34 "After transfer, ImageBitmap become neutered");
35 ok(gImageBitmap2.width == 0 && gImageBitmap2.height == 0,
36 "After transfer, ImageBitmap become neutered");
37 ok(gImageBitmap3.width == 0 && gImageBitmap3.height == 0,
38 "After transfer, ImageBitmap become neutered");
39 });
42 SimpleTest.waitForExplicitFinish();
43 addLoadEvent(runTests);
45 </script>
46 </body>