Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html> | |
|
Aaron Boodman
2012/03/09 01:00:06
Add a license header.
Josh Horwich
2012/03/09 01:21:56
Will do
Josh Horwich
2012/03/09 02:26:25
Done.
| |
| 2 <head> | |
| 3 <title>Background page using 2d canvas</title> | |
| 4 </head> | |
| 5 <body> | |
| 6 <div>Below should be a canvas rendered with canvas2D</div> | |
| 7 <canvas id="my-canvas" width="100" height="100"></canvas> | |
| 8 <script type="application/javascript"> | |
| 9 var succeeded = false; | |
| 10 function test() { | |
| 11 if (succeeded) { | |
| 12 window.domAutomationController.send(true); | |
| 13 } else { | |
| 14 window.domAutomationController.send(false); | |
| 15 } | |
| 16 } | |
| 17 | |
| 18 canvas = document.getElementById("my-canvas"); | |
| 19 if (canvas) { | |
| 20 if (canvas.getContext) { | |
| 21 context = canvas.getContext("2d"); | |
| 22 if (context) { | |
| 23 context.fillStyle = 'red'; | |
| 24 context.fillRect(20, 20, 40, 40); | |
| 25 succeeded = true; | |
| 26 } | |
| 27 } | |
| 28 } | |
| 29 </script> | |
| 30 </body> | |
| 31 </html> | |
| OLD | NEW |