| OLD | NEW |
| 1 description("A copy of the corresponding W3C-SVG-1.1 test, which dumps the anima
tion at certain times"); | 1 description("A copy of the corresponding W3C-SVG-1.1 test, which dumps the anima
tion at certain times"); |
| 2 embedSVGTestCase("../W3C-SVG-1.1/animate-elem-10-t.svg"); | 2 embedSVGTestCase("../W3C-SVG-1.1/animate-elem-10-t.svg"); |
| 3 | 3 |
| 4 // Setup animation test | 4 // Setup animation test |
| 5 function sample1() { | 5 function sample1() { |
| 6 shouldBeCloseEnough("rect1.height.animVal.value", "210"); | 6 shouldBeCloseEnough("rect1.height.animVal.value", "210"); |
| 7 shouldBe("rect1.height.baseVal.value", "210"); | 7 shouldBe("rect1.height.baseVal.value", "210"); |
| 8 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250
", "-250"); | 8 expectTranslationMatrix("getTransformToElement(rootSVGElement, rect2)", "-25
0", "-250"); |
| 9 } | 9 } |
| 10 | 10 |
| 11 function sample2() { | 11 function sample2() { |
| 12 shouldBeCloseEnough("rect1.height.animVal.value", "177"); | 12 shouldBeCloseEnough("rect1.height.animVal.value", "177"); |
| 13 shouldBe("rect1.height.baseVal.value", "210"); | 13 shouldBe("rect1.height.baseVal.value", "210"); |
| 14 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250
", "-217"); | 14 expectTranslationMatrix("getTransformToElement(rootSVGElement, rect2)", "-25
0", "-217"); |
| 15 } | 15 } |
| 16 | 16 |
| 17 function sample3() { | 17 function sample3() { |
| 18 shouldBeCloseEnough("rect1.height.animVal.value", "121"); | 18 shouldBeCloseEnough("rect1.height.animVal.value", "121"); |
| 19 shouldBe("rect1.height.baseVal.value", "210"); | 19 shouldBe("rect1.height.baseVal.value", "210"); |
| 20 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250
", "-161"); | 20 expectTranslationMatrix("getTransformToElement(rootSVGElement, rect2)", "-25
0", "-161"); |
| 21 } | 21 } |
| 22 | 22 |
| 23 function sample4() { | 23 function sample4() { |
| 24 shouldBeCloseEnough("rect1.height.animVal.value", "10"); | 24 shouldBeCloseEnough("rect1.height.animVal.value", "10"); |
| 25 shouldBe("rect1.height.baseVal.value", "210"); | 25 shouldBe("rect1.height.baseVal.value", "210"); |
| 26 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250
", "-50"); | 26 expectTranslationMatrix("getTransformToElement(rootSVGElement, rect2)", "-25
0", "-50"); |
| 27 } | 27 } |
| 28 | 28 |
| 29 function executeTest() { | 29 function executeTest() { |
| 30 var rects = rootSVGElement.ownerDocument.getElementsByTagName("rect"); | 30 var rects = rootSVGElement.ownerDocument.getElementsByTagName("rect"); |
| 31 rect1 = rects[0]; | 31 rect1 = rects[0]; |
| 32 rect2 = rects[1]; | 32 rect2 = rects[1]; |
| 33 | 33 |
| 34 const expectedValues = [ | 34 const expectedValues = [ |
| 35 // [animationId, time, sampleCallback] | 35 // [animationId, time, sampleCallback] |
| 36 ["an1", 0.0, sample1], | 36 ["an1", 0.0, sample1], |
| 37 ["an1", 2.999, sample2], | 37 ["an1", 2.999, sample2], |
| 38 ["an1", 3.001, sample2], | 38 ["an1", 3.001, sample2], |
| 39 ["an1", 5.999, sample3], | 39 ["an1", 5.999, sample3], |
| 40 ["an1", 6.001, sample3], | 40 ["an1", 6.001, sample3], |
| 41 ["an1", 8.999, sample4], | 41 ["an1", 8.999, sample4], |
| 42 ["an1", 9.001, sample4], | 42 ["an1", 9.001, sample4], |
| 43 ["an1", 60.0, sample4] | 43 ["an1", 60.0, sample4] |
| 44 ]; | 44 ]; |
| 45 | 45 |
| 46 runAnimationTest(expectedValues); | 46 runAnimationTest(expectedValues); |
| 47 } | 47 } |
| 48 | 48 |
| 49 window.animationStartsImmediately = true; | 49 window.animationStartsImmediately = true; |
| 50 var successfullyParsed = true; | 50 var successfullyParsed = true; |
| OLD | NEW |