Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / animations / script-tests / animate-number-calcMode-discrete-keyTimes.js
blob198915a307eb10746810077b5fec900978ef9786
1 description("Test calcMode discrete with from-to animation on numbers. You should see a green 100x100 rect and only PASS messages");
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("values", "100;200;300");
17 animate.setAttribute("begin", "click");
18 animate.setAttribute("dur", "3s");
19 animate.setAttribute("keyTimes", "0;0.5;1");
20 animate.setAttribute("calcMode", "discrete");
21 animate.setAttribute("fill", "freeze");
22 rect.appendChild(animate);
23 rootSVGElement.appendChild(rect);
25 // Setup animation test
26 function sample1() {
27 shouldBe("rect.x.animVal.value", "100");
28 shouldBe("rect.x.baseVal.value", "100");
31 function sample2() {
32 shouldBe("rect.x.animVal.value", "200");
33 shouldBe("rect.x.baseVal.value", "100");
36 function sample3() {
37 shouldBe("rect.x.animVal.value", "300");
38 shouldBe("rect.x.baseVal.value", "100");
41 function executeTest() {
42 const expectedValues = [
43 // [animationId, time, sampleCallback]
44 ["animation", 0.0, sample1],
45 ["animation", 1.499, sample1],
46 ["animation", 1.501, sample2],
47 ["animation", 2.999, sample2],
48 ["animation", 3.001, sample3]
51 runAnimationTest(expectedValues);
54 window.clickX = 150;
55 var successfullyParsed = true;