Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / animations / script-tests / svglength-animation-invalid-value-2.js
blob8f041bbc47f6e86cccecb7c5d9bb27fcb7fcb0e2
1 description("Test SVGLength animation with invalid value: No spaces before value.");
2 createSVGTestCase();
4 // Setup test document
5 var rect = createSVGElement("rect");
6 rect.setAttribute("id", "rect");
7 rect.setAttribute("x", "0");
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", "width");
16 animate.setAttribute("begin", "click");
17 animate.setAttribute("dur", "4s");
18 animate.setAttribute("from", " 100pxERROR");
19 animate.setAttribute("to", " 200pxERROR");
20 rect.appendChild(animate);
21 rootSVGElement.appendChild(rect);
23 // Setup animation test
24 function sample1() {
25 // Check initial/end conditions
26 shouldBeCloseEnough("rect.width.animVal.value", "100");
27 shouldBe("rect.width.baseVal.value", "100");
30 function sample2() {
31 shouldBeCloseEnough("rect.width.animVal.value", "0");
32 shouldBe("rect.width.baseVal.value", "100");
35 function executeTest() {
36 const expectedValues = [
37 // [animationId, time, sampleCallback]
38 ["animation", 0.0, sample1],
39 ["animation", 2.0, sample2],
40 ["animation", 3.999, sample2],
41 ["animation", 4.001, sample1]
44 runAnimationTest(expectedValues);
47 var successfullyParsed = true;