Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / canvas / test / test_2d.imageData.create.initial.html
blobf9097bc33c923d6d4983f54d19cc72f5773a3cbd
1 <!DOCTYPE HTML>
2 <title>Canvas test: 2d.imageData.create.initial - bug 433004</title>
3 <!-- Testing: createImageData() returns transparent black data of the right size -->
4 <script src="/MochiKit/MochiKit.js"></script>
5 <script src="/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" href="/tests/SimpleTest/test.css">
7 <body>
8 <canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
9 <script>
11 SimpleTest.waitForExplicitFinish();
12 MochiKit.DOM.addLoadEvent(function () {
14 var canvas = document.getElementById('c');
15 var ctx = canvas.getContext('2d');
17 var imgdata = ctx.createImageData(10, 20);
18 ok(imgdata.data.length == imgdata.width*imgdata.height*4, "imgdata.data.length == imgdata.width*imgdata.height*4");
19 ok(imgdata.width < imgdata.height, "imgdata.width < imgdata.height");
20 ok(imgdata.width > 0, "imgdata.width > 0");
21 var isTransparentBlack = true;
22 for (var i = 0; i < imgdata.data.length; ++i)
23 if (imgdata.data[i] !== 0)
24 isTransparentBlack = false;
25 ok(isTransparentBlack, "isTransparentBlack");
27 SimpleTest.finish();
29 });
30 </script>