| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <script src="../../resources/testharness.js"></script> |
| 2 <html> | 2 <script src="../../resources/testharnessreport.js"></script> |
| 3 <head> | |
| 4 <script src="../../resources/js-test.js"></script> | |
| 5 </head> | |
| 6 <body> | |
| 7 <p id="description"></p> | 3 <p id="description"></p> |
| 8 <div id="console"></div> | 4 <div id="console"></div> |
| 9 | 5 |
| 10 <script> | 6 <script> |
| 11 description("Tests CanvasPathMethods arc and arcTo with negative radii."); | 7 test(function(t) { |
| 8 var canvas = document.createElement("canvas"); |
| 9 var ctx = canvas.getContext('2d'); |
| 12 | 10 |
| 13 var canvas = document.createElement("canvas"); | 11 ctx.arc(10, 10, 5, 0, 1, false); |
| 14 var ctx = canvas.getContext('2d'); | 12 ctx.arc(10, 10, 0, 0, 1, false); |
| 13 assert_throws(null, function() {ctx.arc(10, 10, -5, 0, 1, false);}); |
| 15 | 14 |
| 16 shouldNotThrow("ctx.arc(10, 10, 5, 0, 1, false)"); | 15 ctx.arcTo(10, 10, 20, 20, 5); |
| 17 shouldNotThrow("ctx.arc(10, 10, 0, 0, 1, false)"); | 16 ctx.arcTo(10, 10, 20, 20, 0); |
| 18 shouldThrow("ctx.arc(10, 10, -5, 0, 1, false)"); | 17 assert_throws(null, function() {ctx.arcTo(10, 10, 20, 20, -5);}); |
| 19 | 18 |
| 20 shouldNotThrow("ctx.arcTo(10, 10, 20, 20, 5)") | 19 var path = new Path2D(); |
| 21 shouldNotThrow("ctx.arcTo(10, 10, 20, 20, 0)") | |
| 22 shouldThrow("ctx.arcTo(10, 10, 20, 20, -5)") | |
| 23 | 20 |
| 24 var path = new Path2D(); | 21 path.arc(10, 10, 5, 0, 1, false); |
| 22 path.arc(10, 10, 0, 0, 1, false); |
| 23 assert_throws(null, function() {path.arc(10, 10, -5, 0, 1, false);}); |
| 25 | 24 |
| 26 shouldNotThrow("path.arc(10, 10, 5, 0, 1, false)"); | 25 path.arcTo(10, 10, 20, 20, 5); |
| 27 shouldNotThrow("path.arc(10, 10, 0, 0, 1, false)"); | 26 path.arcTo(10, 10, 20, 20, 0); |
| 28 shouldThrow("path.arc(10, 10, -5, 0, 1, false)"); | 27 assert_throws(null, function() {path.arcTo(10, 10, 20, 20, -5);}); |
| 29 | 28 }, 'Tests CanvasPathMethods arc and arcTo with negative radii.'); |
| 30 shouldNotThrow("path.arcTo(10, 10, 20, 20, 5)") | |
| 31 shouldNotThrow("path.arcTo(10, 10, 20, 20, 0)") | |
| 32 shouldThrow("path.arcTo(10, 10, 20, 20, -5)") | |
| 33 </script> | 29 </script> |
| 34 </body> | |
| 35 </html> | |
| OLD | NEW |