Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / animations / script-tests / animate-from-to-keyTimes.js
bloba384d0af3964abf6b3d30345f73959e489d3886d
1 description("Tests discrete from-to-keyTimes animations");
2 createSVGTestCase();
4 // Setup test document
5 var rect = createSVGElement("rect");
6 rect.setAttribute("id", "rect");
7 rect.setAttribute("x", "100");
8 rect.setAttribute("width", "100");
9 rect.setAttribute("height", "100");
10 rect.setAttribute("fill", "green");
11 rect.setAttribute("onclick", "executeTest()");
13 var animate = createSVGElement("animate");
14 animate.setAttribute("id", "animation");
15 animate.setAttribute("attributeName", "x");
16 animate.setAttribute("to", "200");
17 animate.setAttribute("dur", "4s");
18 animate.setAttribute("keyTimes", "0;0.25");
19 animate.setAttribute("calcMode", "discrete");
20 animate.setAttribute("fill", "freeze");
21 rect.appendChild(animate);
22 rootSVGElement.appendChild(rect);
24 // Setup animation test
25 function sample1() {
26 shouldBe("rect.x.animVal.value", "100");
27 shouldBe("rect.x.baseVal.value", "100");
30 function sample2() {
31 shouldBe("rect.x.animVal.value", "200");
32 shouldBe("rect.x.baseVal.value", "100");
35 function executeTest() {
36 const expectedValues = [
37 // [animationId, time, sampleCallback]
38 ["animation", 0.5, sample1],
39 ["animation", 1.5, sample2],
40 ["animation", 2.5, sample2]
43 runAnimationTest(expectedValues);
46 window.clickX = 150;
47 var successfullyParsed = true;