Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / animations / script-tests / svglength-animation-LengthModeWidth.js
blob134a4e6e4ed28dca1eb29b575645c00ee5597173
1 description("Test SVGLength animation on LengthModeWidth.");
2 createSVGTestCase();
4 // Setup test document
5 rootSVGElement.setAttribute("width", "600");
6 rootSVGElement.setAttribute("height", "400");
8 // Setup test document
9 var rect = createSVGElement("rect");
10 rect.setAttribute("id", "rect");
11 rect.setAttribute("x", "0");
12 rect.setAttribute("width", "100");
13 rect.setAttribute("height", "100");
14 rect.setAttribute("fill", "green");
15 rect.setAttribute("font-size", "10px");
16 rect.setAttribute("onclick", "executeTest()");
18 var animate = createSVGElement("animate");
19 animate.setAttribute("id", "animation");
20 animate.setAttribute("attributeName", "width");
21 animate.setAttribute("begin", "click");
22 animate.setAttribute("dur", "4s");
23 animate.setAttribute("from", "100");
24 animate.setAttribute("to", "50%");
25 rect.appendChild(animate);
26 rootSVGElement.appendChild(rect);
28 // Setup animation test
29 function sample1() {
30 // Check initial/end conditions
31 shouldBeCloseEnough("rect.width.animVal.value", "100");
32 shouldBe("rect.width.baseVal.value", "100");
35 function sample2() {
36 shouldBeCloseEnough("rect.width.animVal.value", "200");
37 shouldBe("rect.width.baseVal.value", "100");
40 function sample3() {
41 shouldBeCloseEnough("rect.width.animVal.value", "300");
42 shouldBe("rect.width.baseVal.value", "100");
45 function executeTest() {
46 const expectedValues = [
47 // [animationId, time, sampleCallback]
48 ["animation", 0.0, sample1],
49 ["animation", 2.0, sample2],
50 ["animation", 3.999, sample3],
51 ["animation", 4.001, sample1]
54 runAnimationTest(expectedValues);
57 var successfullyParsed = true;