- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / gpu / canvas_popup.html
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script>
5 function popup() {
6   var w = window.open("","","width=200,height=200");
7   var canvas = w.document.createElement("canvas");
8   canvas.width = 100;
9   canvas.height = 100;
10   w.document.body.appendChild(canvas);
11
12   var ctx = canvas.getContext('2d');
13   ctx.fillStyle = "rgb(255,165,0)";
14   ctx.fillRect(0, 0, 100, 100);
15
16   var imageData = ctx.getImageData(50, 50, 1, 1);
17   document.title = imageData.data[0] + ", " +
18       imageData.data[1] + ", " +
19       imageData.data[2];
20
21   window.domAutomationController.setAutomationId(1);
22   if (imageData.data[0] == 255 &&
23       imageData.data[1] == 165 &&
24       imageData.data[2] == 0)
25     window.domAutomationController.send("SUCCESS");
26   else
27     window.domAutomationController.send("FAILED");
28 }
29 </script>
30 </head>
31 <body onload="popup()">
32 </body>
33 </html>