Bug 1928997: Update tabs icon in Unified Search popup r=desktop-theme-reviewers,daleh...
[gecko.git] / dom / canvas / test / test_imagebitmap_structuredclone.html
blob32c3ba91e09b62968296c8b27d0b24108ad58e91
1 <!DOCTYPE HTML>
2 <title>Test ImageBitmap : Structured Clone</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 });
34 SimpleTest.waitForExplicitFinish();
35 addLoadEvent(runTests);
37 </script>
38 </body>