Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!-- | 1 <!-- |
| 2 Creates a canvas which is filled red, then attempts to | 2 Creates a canvas which is filled red, then attempts to |
| 3 fill a number of 0 size rects, finally fills with green. | 3 fill a number of 0 size rects, finally fills with green. |
| 4 | 4 |
| 5 Fill of a 0-sized rect should not throw an exception, so | 5 Fill of a 0-sized rect should not throw an exception, so |
| 6 we expected the output to be a green rect. | 6 we expected the output to be a green rect. |
| 7 --> | 7 --> |
| 8 <html> | 8 <html> |
| 9 <head> | 9 <head> |
| 10 <script type="text/javascript"> | 10 <script type="text/javascript"> |
| 11 window.onload = function() { | 11 window.onload = function() { |
| 12 » if (window.testRunner) | 12 if (window.testRunner) |
| 13 » testRunner.dumpAsTextWithPixelResults(); | 13 » testRunner.dumpAsText(); |
|
Stephen White
2014/03/05 21:29:33
Nit: tab instead of spaces (not new to this patch)
| |
| 14 » | |
| 15 var canvas = document.getElementById("test"); | 14 var canvas = document.getElementById("test"); |
| 16 var context = canvas.getContext("2d"); | 15 var context = canvas.getContext("2d"); |
| 17 context.fillStyle = '#f00'; | 16 context.fillStyle = '#f00'; |
| 18 context.fillRect(0, 0, canvas.width, canvas.height); | 17 context.fillRect(0, 0, canvas.width, canvas.height); |
| 19 try { | 18 try { |
| 20 context.fillRect(0, 0, 0, 0); | 19 context.fillRect(0, 0, 0, 0); |
| 21 context.fillRect(0, 0, canvas.width, 0); | 20 context.fillRect(0, 0, canvas.width, 0); |
| 22 context.fillRect(0, 0, 0, canvas.height); | 21 context.fillRect(0, 0, 0, canvas.height); |
| 23 } catch (e) { | 22 } catch (e) { |
| 24 var node = document.createTextNode("FAIL -- an exception was thrown when drawing a 0 sized rect"); | 23 var node = document.createTextNode("FAIL -- an exception was thrown when drawing a 0 sized rect"); |
| 25 document.getElementById("body").appendChild(node); | 24 document.getElementById("body").appendChild(node); |
| 26 return; | 25 return; |
| 27 } | 26 } |
| 28 context.fillStyle = '#0f0'; | 27 context.fillStyle = '#0f0'; |
| 29 context.fillRect(0, 0, canvas.width, canvas.height); | 28 context.fillRect(0, 0, canvas.width, canvas.height); |
| 30 var node = document.createTextNode("PASS -- 0 sized rects did not trigger an exception"); | 29 var node = document.createTextNode("PASS -- 0 sized rects did not trigger an exception"); |
| 31 document.getElementById("body").appendChild(node); | 30 document.getElementById("body").appendChild(node); |
| 32 } | 31 } |
| 33 </script> | 32 </script> |
| 34 <title>borkedness</title> | 33 <title>borkedness</title> |
| 35 </head> | 34 </head> |
| 36 <body id="body"> | 35 <body id="body"> |
| 37 <canvas id="test" width="100" height="100"></canvas> | 36 <canvas id="test" width="100" height="100"></canvas> |
| 38 <br> | 37 <br> |
| 39 </body> | 38 </body> |
| 40 </html> | 39 </html> |
| OLD | NEW |