Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / animations / script-tests / svgboolean-animation-1.js
blob58a89888ed4a5a73a4bd705745a5637a64587971
1 description("Test 'to' animation of SVGBoolean.");
2 createSVGTestCase();
4 // Setup test document
5 var defs = createSVGElement("defs");
6 rootSVGElement.appendChild(defs);
8 var filter = createSVGElement("filter");
9 filter.setAttribute("id", "filter");
10 defs.appendChild(filter);
12 var feConvolveMatrix = createSVGElement("feConvolveMatrix");
13 feConvolveMatrix.setAttribute("id", "effect");
14 feConvolveMatrix.setAttribute("kernelMatrix", "0 0 0 0 1 0 0 0 0");
15 feConvolveMatrix.setAttribute("preserveAlpha", "false");
16 filter.appendChild(feConvolveMatrix);
18 var rect = createSVGElement("rect");
19 rect.setAttribute("id", "rect");
20 rect.setAttribute("width", "100");
21 rect.setAttribute("height", "100");
22 rect.setAttribute("fill", "green");
23 rect.setAttribute("filter", "url(#filter)");
24 rect.setAttribute("onclick", "executeTest()");
25 rootSVGElement.appendChild(rect);
27 var animate = createSVGElement("animate");
28 animate.setAttribute("id", "animation");
29 animate.setAttribute("attributeName", "preserveAlpha");
30 animate.setAttribute("begin", "rect.click");
31 animate.setAttribute("dur", "4s");
32 animate.setAttribute("from", "false");
33 animate.setAttribute("to", "true");
34 feConvolveMatrix.appendChild(animate);
36 // Setup animation test
37 function sample1() {
38 shouldBe("feConvolveMatrix.preserveAlpha.animVal", "false");
39 shouldBe("feConvolveMatrix.preserveAlpha.baseVal", "false");
42 function sample2() {
43 shouldBe("feConvolveMatrix.preserveAlpha.animVal", "false");
44 shouldBe("feConvolveMatrix.preserveAlpha.baseVal", "false");
47 function sample3() {
48 shouldBe("feConvolveMatrix.preserveAlpha.animVal", "true");
49 shouldBe("feConvolveMatrix.preserveAlpha.baseVal", "false");
52 function executeTest() {
53 const expectedValues = [
54 // [animationId, time, sampleCallback]
55 ["animation", 0.0, sample1],
56 ["animation", 2.0, sample2],
57 ["animation", 3.999, sample3],
58 ["animation", 4.001, sample1]
61 runAnimationTest(expectedValues);
64 var successfullyParsed = true;