OLD | NEW |
1 description("Series of tests to ensure stroke() works with optional path paramet
er."); | 1 description("Series of tests to ensure stroke() works with optional path paramet
er."); |
2 | 2 |
3 var ctx = document.getElementById('canvas').getContext('2d'); | 3 var ctx = document.getElementById('canvas').getContext('2d'); |
4 | 4 |
5 function pixelDataAtPoint() { | 5 function pixelDataAtPoint() { |
6 return ctx.getImageData(75, 75, 1, 1).data; | 6 return ctx.getImageData(75, 75, 1, 1).data; |
7 } | 7 } |
8 | 8 |
9 function checkResult(expectedColors, sigma) { | 9 function checkResult(expectedColors, sigma) { |
10 for (var i = 0; i < 4; i++) | 10 for (var i = 0; i < 4; i++) |
(...skipping 29 matching lines...) Expand all Loading... |
40 // Execute test. | 40 // Execute test. |
41 function prepareTestScenario() { | 41 function prepareTestScenario() { |
42 var path = new Path2D(); | 42 var path = new Path2D(); |
43 drawRectangleOn(path); | 43 drawRectangleOn(path); |
44 | 44 |
45 testStrokeWith(); | 45 testStrokeWith(); |
46 testStrokeWith(path); | 46 testStrokeWith(path); |
47 | 47 |
48 // Test exception cases. | 48 // Test exception cases. |
49 shouldThrow("ctx.stroke(null)"); | 49 shouldThrow("ctx.stroke(null)"); |
| 50 shouldThrow("ctx.stroke(undefined)"); |
50 shouldThrow("ctx.stroke([])"); | 51 shouldThrow("ctx.stroke([])"); |
51 shouldThrow("ctx.stroke({})"); | 52 shouldThrow("ctx.stroke({})"); |
52 } | 53 } |
53 | 54 |
54 // Run test and allow variation of results. | 55 // Run test and allow variation of results. |
55 prepareTestScenario(); | 56 prepareTestScenario(); |
OLD | NEW |