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