a3b7ce7a6148ce34093884fc0db1ddfca2123b91
[WebKit-https.git] / LayoutTests / fast / canvas / canvas-backing-store-reuse.html
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script src="../../resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <script>
8 if (window.testRunner)
9     testRunner.dumpAsText();
10
11 (function() {
12   var canvas = document.createElement("canvas");
13   canvas.width = 99;
14   canvas.height = 99;
15   var context = canvas.getContext("2d");
16   context.fillStyle = '#f00';
17   context.fillRect(0, 0, 100, 100);
18 })();
19
20 if (window.GCController)
21   GCController.collect();
22
23 var canvas = document.createElement("canvas");
24 canvas.width = 95;
25 canvas.height = 95;
26 var context = canvas.getContext("2d");
27 var data = context.getImageData(50, 50, 1, 1);
28 shouldBe("data.data", "[0, 0, 0, 0]");
29 document.body.appendChild(canvas);
30 </script>
31 <script src="../../resources/js-test-post.js"></script>
32 </body>
33 </html>