blob: 0bb7e0c21ea45cc0ccc52064fb98f0d020bd406d [file] [log] [blame]
zimmermann@webkit.org65103632012-03-13 08:27:14 +00001<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2<html>
3<head>
mark.lam@apple.com1ca737d2013-09-08 05:29:22 +00004<script src="../../resources/js-test-pre.js"></script>
zimmermann@webkit.org65103632012-03-13 08:27:14 +00005<script src="../dynamic-updates/resources/SVGTestCase.js"></script>
6<script src="resources/SVGAnimationTestCase.js"></script>
7</head>
8<body onload="runSMILTest()">
9<h1>SVG 1.1 dynamic animation tests</h1>
10<p id="description"></p>
11<div id="console"></div>
ap@apple.com92352d02017-05-24 22:53:00 +000012<script>
13description("This tests scripting baseVal while animation is running");
14embedSVGTestCase("resources/change-baseVal-while-animating-fill-remove.svg");
15
16// Setup animation test
17function sample1() {
18 shouldBeCloseEnough("rect.width.animVal.value", "10");
19 shouldBe("rect.width.baseVal.value", "10");
20}
21
22function sample2() {
23 shouldBeCloseEnough("rect.width.animVal.value", "30");
24 shouldBe("rect.width.baseVal.value", "10");
25
26 rect.setAttribute("width", "100");
27}
28
29function sample3() {
30 shouldBeCloseEnough("rect.width.animVal.value", "30");
31 shouldBe("rect.width.baseVal.value", "100");
32}
33
34function sample4() {
35 shouldBeCloseEnough("rect.width.animVal.value", "50");
36 shouldBe("rect.width.baseVal.value", "100");
37}
38
39function sample5() {
40 shouldBe("rect.width.animVal.value", "100");
41 shouldBe("rect.width.baseVal.value", "100");
42}
43
44function executeTest() {
45 rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0];
46
47 // All animations in the test file use the same duration, so it's not needed to list all sample points individually for an5/an6/an7/an8.
48 const expectedValues = [
49 // [animationId, time, sampleCallback]
50 ["an1", 0.0, sample1],
51 ["an1", 2.0, sample2],
52 ["an1", 2.001, sample3],
53 ["an1", 3.999, sample4],
54 ["an1", 4.001, sample5],
55 ["an1", 60.0, sample5]
56 ];
57
58 runAnimationTest(expectedValues);
59}
60
61window.animationStartsImmediately = true;
62var successfullyParsed = true;
63</script>
zimmermann@webkit.org65103632012-03-13 08:27:14 +000064</body>
65</html>