OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script type="text/javascript"> |
| 4 function debug(str) { |
| 5 var c = document.getElementById('console') |
| 6 c.appendChild(document.createTextNode(str + '\n')); |
| 7 } |
| 8 |
| 9 function runTests() { |
| 10 debug("This tests that we don't crash when passing inf as a parameter to ell
ipse"); |
| 11 var canvas = document.getElementById("test"); |
| 12 var context = canvas.getContext("2d"); |
| 13 context.fillStyle = '#f00'; |
| 14 context.fillRect(0, 0, canvas.width, canvas.height); |
| 15 try { |
| 16 context.ellipse(10, 10, 20, 20, 0, 20, 1.0/0.0, true); |
| 17 context.ellipse(10, 10, 20, 20, 0, 20, 1.0/0.0, true); |
| 18 context.ellipse(10, 10, 1.0/0.0, 0, 0, 20, 20, true); |
| 19 context.ellipse(10, 10, 0, 1.0/0.0, 0, 20, 20, true); |
| 20 context.ellipse(10, 10, 20, 20, 1.0/0.0, 20, 20, true); |
| 21 context.ellipse(10, 10, 20, 20, 0, 1.0/0.0, 20, true); |
| 22 context.ellipse(10, 1.0/0.0, 10, 10, 0, 20, 20, true); |
| 23 context.ellipse(1.0/0.0, 10, 10, 10, 0, 20, 20, true); |
| 24 context.ellipse(10, 10, 20, 20, 0, 20, 1.0/0.0, false); |
| 25 context.ellipse(10, 10, 1.0/0.0, 0, 0, 20, 20, false); |
| 26 context.ellipse(10, 10, 0, 1.0/0.0, 0, 20, 20, false); |
| 27 context.ellipse(10, 10, 20, 20, 1.0/0.0, 20, 20, false); |
| 28 context.ellipse(10, 10, 20, 20, 0, 1.0/0.0, 20, false); |
| 29 context.ellipse(10, 1.0/0.0, 10, 10, 0, 20, 20, false); |
| 30 context.ellipse(1.0/0.0, 10, 10, 10, 0, 20, 20, false); |
| 31 } catch (e) { |
| 32 } |
| 33 context.fillStyle = '#0f0'; |
| 34 context.fillRect(0, 0, canvas.width, canvas.height); |
| 35 debug("Test passed."); |
| 36 if (window.testRunner) |
| 37 testRunner.dumpAsText(); |
| 38 } |
| 39 </script> |
| 40 <title>borkedness</title> |
| 41 </head> |
| 42 <body> |
| 43 <canvas id="test" width="100" height="100"></canvas><br/> |
| 44 <pre id="console"></pre> |
| 45 <script> |
| 46 runTests(); |
| 47 </script> |
| 48 </body> |
| 49 </html> |
| 50 |
OLD | NEW |