OLD | NEW |
---|---|
1 <!DOCTYPE HTML> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>Test CanvasWindingRule enumeration</title> |
3 <head> | |
4 <script src="../../resources/js-test.js"></script> | |
5 </head> | |
6 <body> | |
7 | 3 |
4 <script src="../../resources/testharness.js"></script> | |
5 <script src="../../resources/testharnessreport.js"></script> | |
6 | |
7 <canvas></canvas> | |
fs
2016/09/08 10:13:10
Probably good the way it was (w/ createElement.)
Abhishek Kanike
2016/09/14 04:33:57
Done.
| |
8 <script> | 8 <script> |
9 var canvas = document.createElement("canvas"); | 9 test(function() { |
10 var canvas = document.querySelector('canvas'); | |
fs
2016/09/08 10:13:10
Indent 2 or 4 spaces within the test-function body
Abhishek Kanike
2016/09/14 04:33:57
Done.
| |
10 var context = canvas.getContext("2d"); | 11 var context = canvas.getContext("2d"); |
11 | 12 |
12 shouldNotThrow("context.fill()"); | 13 context.fill(); |
13 shouldNotThrow("context.fill('nonzero')"); | 14 context.fill('nonzero'); |
14 shouldThrow("context.fill('randomstring')"); | 15 assert_throws(new TypeError(), function() { context.fill('randomstring'); }); |
15 | 16 |
16 shouldNotThrow("context.clip()"); | 17 context.clip(); |
17 shouldNotThrow("context.clip('nonzero')"); | 18 context.clip('nonzero'); |
18 shouldThrow("context.clip('randomstring')"); | 19 assert_throws(new TypeError(), function() { context.clip('randomstring'); }); |
19 | 20 |
20 shouldNotThrow("context.isPointInPath(0, 0)"); | 21 context.isPointInPath(0, 0); |
21 shouldNotThrow("context.isPointInPath(0, 0, 'nonzero')"); | 22 context.isPointInPath(0, 0, 'nonzero'); |
22 shouldThrow("context.isPointInPath(0, 0, 'randomstring')"); | 23 assert_throws(new TypeError(), function() { context.isPointInPath(0, 0, 'randoms tring'); }); |
23 </script> | 24 }); |
24 | 25 </script> |
25 </body> | |
26 | |
OLD | NEW |