1 description("Trivial animVal testcase, to see wheter we support it at all. Should result in a 200x200 rect and only PASS messages");
5 var rect
= createSVGElement("rect");
6 rect
.setAttribute("id", "rect");
7 rect
.setAttribute("width", "200");
8 rect
.setAttribute("height", "200");
9 rect
.setAttribute("fill", "green");
10 rect
.setAttribute("onclick", "executeTest()");
12 var animate
= createSVGElement("animate");
13 animate
.setAttribute("id", "animation");
14 animate
.setAttribute("attributeName", "width");
15 animate
.setAttribute("from", "200");
16 animate
.setAttribute("to", "100");
17 animate
.setAttribute("begin", "click");
18 animate
.setAttribute("dur", "4s");
19 rect
.appendChild(animate
);
20 rootSVGElement
.appendChild(rect
);
22 // Setup animation test
24 // Check initial/end conditions
25 shouldBeCloseEnough("rect.width.animVal.value", "200");
26 shouldBe("rect.width.baseVal.value", "200");
30 // Check half-time conditions
31 shouldBeCloseEnough("rect.width.animVal.value", "150");
32 shouldBe("rect.width.baseVal.value", "200");
36 // Check just before-end conditions
37 shouldBeCloseEnough("rect.width.animVal.value", "100");
38 shouldBe("rect.width.baseVal.value", "200");
41 function executeTest() {
42 const expectedValues
= [
43 // [animationId, time, sampleCallback]
44 ["animation", 0.0, sample1
],
45 ["animation", 2.0, sample2
],
46 ["animation", 3.999, sample3
],
47 ["animation", 4.001, sample1
]
50 runAnimationTest(expectedValues
);
53 var successfullyParsed
= true;