OLD | NEW |
| (Empty) |
1 Test the behavior of isPointInStroke in Canvas with path object | |
2 | |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | |
4 | |
5 | |
6 Initial behavior: lineWidth = 1.0 | |
7 PASS ctx.isPointInStroke(path,20,20) is true | |
8 PASS ctx.isPointInStroke(path,120,20) is true | |
9 PASS ctx.isPointInStroke(path,20,120) is true | |
10 PASS ctx.isPointInStroke(path,120,120) is true | |
11 PASS ctx.isPointInStroke(path,70,20) is true | |
12 PASS ctx.isPointInStroke(path,20,70) is true | |
13 PASS ctx.isPointInStroke(path,120,70) is true | |
14 PASS ctx.isPointInStroke(path,70,120) is true | |
15 PASS ctx.isPointInStroke(path,22,22) is false | |
16 PASS ctx.isPointInStroke(path,118,22) is false | |
17 PASS ctx.isPointInStroke(path,22,118) is false | |
18 PASS ctx.isPointInStroke(path,118,118) is false | |
19 PASS ctx.isPointInStroke(path,70,18) is false | |
20 PASS ctx.isPointInStroke(path,122,70) is false | |
21 PASS ctx.isPointInStroke(path,70,122) is false | |
22 PASS ctx.isPointInStroke(path,18,70) is false | |
23 PASS ctx.isPointInStroke(path,NaN,122) is false | |
24 PASS ctx.isPointInStroke(path,18,NaN) is false | |
25 | |
26 Check invalid type | |
27 PASS ctx.isPointInStroke(null,70,20) threw exception TypeError: Failed to execut
e 'isPointInStroke' on 'CanvasRenderingContext2D': parameter 1 is not of type 'P
ath2D'.. | |
28 PASS ctx.isPointInStroke(undefined,70,20) threw exception TypeError: Failed to e
xecute 'isPointInStroke' on 'CanvasRenderingContext2D': parameter 1 is not of ty
pe 'Path2D'.. | |
29 PASS ctx.isPointInStroke([],20,70) threw exception TypeError: Failed to execute
'isPointInStroke' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Pat
h2D'.. | |
30 PASS ctx.isPointInStroke({},120,70) threw exception TypeError: Failed to execute
'isPointInStroke' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Pa
th2D'.. | |
31 | |
32 Set lineWidth = 10.0 | |
33 PASS ctx.isPointInStroke(path,22,22) is true | |
34 PASS ctx.isPointInStroke(path,118,22) is true | |
35 PASS ctx.isPointInStroke(path,22,118) is true | |
36 PASS ctx.isPointInStroke(path,118,118) is true | |
37 PASS ctx.isPointInStroke(path,70,18) is true | |
38 PASS ctx.isPointInStroke(path,122,70) is true | |
39 PASS ctx.isPointInStroke(path,70,122) is true | |
40 PASS ctx.isPointInStroke(path,18,70) is true | |
41 PASS ctx.isPointInStroke(path,26,70) is false | |
42 PASS ctx.isPointInStroke(path,70,26) is false | |
43 PASS ctx.isPointInStroke(path,70,114) is false | |
44 PASS ctx.isPointInStroke(path,114,70) is false | |
45 | |
46 Check lineJoin = 'bevel' | |
47 PASS ctx.isPointInStroke(path,113,20) is false | |
48 | |
49 Check lineJoin = 'miter' | |
50 PASS ctx.isPointInStroke(path,113,20) is true | |
51 | |
52 Check miterLimit = 2.0 | |
53 PASS ctx.isPointInStroke(path,113,20) is false | |
54 | |
55 Check lineCap = 'butt' | |
56 PASS ctx.isPointInStroke(path,112,10) is false | |
57 | |
58 Check lineCap = 'round' | |
59 PASS ctx.isPointInStroke(path,112,10) is true | |
60 PASS ctx.isPointInStroke(path,117,10) is false | |
61 | |
62 Check lineCap = 'square' | |
63 PASS ctx.isPointInStroke(path,112,10) is true | |
64 PASS ctx.isPointInStroke(path,117,10) is false | |
65 | |
66 Check setLineDash([10,10]) | |
67 PASS ctx.isPointInStroke(path,15,10) is true | |
68 PASS ctx.isPointInStroke(path,25,10) is false | |
69 PASS ctx.isPointInStroke(path,35,10) is true | |
70 | |
71 Check dashOffset = 10 | |
72 PASS ctx.isPointInStroke(path,15,10) is false | |
73 PASS ctx.isPointInStroke(path,25,10) is true | |
74 PASS ctx.isPointInStroke(path,35,10) is false | |
75 PASS successfullyParsed is true | |
76 | |
77 TEST COMPLETE | |
78 | |
OLD | NEW |