OLD | NEW |
1 description("Test for animation freeze when repeatDur is not a multiple of dur")
; | 1 description("Test animations that only express an offset"); |
2 embedSVGTestCase("resources/animateMotion-fill-freeze.svg"); | 2 embedSVGTestCase("resources/animateMotion-still.svg"); |
3 | 3 |
4 // Setup animation test | 4 // Setup animation test |
5 function sample1() { | 5 function sample1() { |
| 6 shouldBeCloseEnough("rootSVGElement.getBBox().x", "100"); |
| 7 } |
| 8 |
| 9 function sample2() { |
| 10 shouldBeCloseEnough("rootSVGElement.getBBox().x", "200"); |
| 11 } |
| 12 |
| 13 function sample3() { |
| 14 shouldBeCloseEnough("rootSVGElement.getBBox().x", "200"); |
| 15 } |
| 16 |
| 17 function sample4() { |
6 shouldBeCloseEnough("rootSVGElement.getBBox().x", "0"); | 18 shouldBeCloseEnough("rootSVGElement.getBBox().x", "0"); |
7 } | 19 } |
8 | 20 |
9 function sample2() { | 21 function sample5() { |
10 shouldBeCloseEnough("rootSVGElement.getBBox().x", "50"); | 22 shouldBeCloseEnough("rootSVGElement.getBBox().x", "0"); |
11 } | |
12 | |
13 function sample3() { | |
14 shouldBeCloseEnough("rootSVGElement.getBBox().x", "100"); | |
15 } | |
16 | |
17 function sample4() { | |
18 shouldBeCloseEnough("rootSVGElement.getBBox().x", "100"); | |
19 } | 23 } |
20 | 24 |
21 function executeTest() { | 25 function executeTest() { |
22 var rects = rootSVGElement.ownerDocument.getElementsByTagName("rect"); | 26 var rects = rootSVGElement.ownerDocument.getElementsByTagName("rect"); |
23 rect1 = rects[0]; | 27 rect1 = rects[0]; |
24 | 28 |
25 const expectedValues = [ | 29 const expectedValues = [ |
26 // [animationId, time, sampleCallback] | 30 // [animationId, time, sampleCallback] |
27 ["anim", 0.0, sample1], | 31 ["anim", 1.0, sample1], |
28 ["anim", 2.0, sample2], | 32 ["anim", 2.0, sample2], |
29 ["anim", 4.0, sample3], | 33 ["anim", 3.0, sample3], |
30 ["anim", 6.0, sample4] | 34 ["anim", 4.0, sample4], |
| 35 ["anim", 5.0, sample5] |
31 ]; | 36 ]; |
32 | 37 |
33 runAnimationTest(expectedValues); | 38 runAnimationTest(expectedValues); |
34 } | 39 } |
35 | 40 |
36 window.animationStartsImmediately = true; | 41 window.animationStartsImmediately = true; |
37 var successfullyParsed = true; | 42 var successfullyParsed = true; |
OLD | NEW |