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 Path(); | 42 var path = new Path(); |
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([])"); |
| 51 shouldThrow("ctx.stroke({})"); |
50 } | 52 } |
51 | 53 |
52 // Run test and allow variation of results. | 54 // Run test and allow variation of results. |
53 prepareTestScenario(); | 55 prepareTestScenario(); |
OLD | NEW |