Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / animations / script-tests / animate-elem-19-t-drt.js
blob8be98164a8376ac2ab24a98da00f9da91e4efa59
1 description("A copy of the corresponding W3C-SVG-1.1 test, which dumps the animation at certain times");
2 embedSVGTestCase("../W3C-SVG-1.1/animate-elem-19-t.svg");
4 // Setup animation test
5 function sample1() { // From 0s to 4s
6 shouldBeCloseEnough("rect.width.animVal.value", "300");
7 shouldBe("rect.width.baseVal.value", "300");
10 function sample2() { // From 4s to 6s
11 shouldBeCloseEnough("rect.width.animVal.value", "255");
12 shouldBe("rect.width.baseVal.value", "300");
15 function sample3() { // From 6s to 8s
16 shouldBeCloseEnough("rect.width.animVal.value", "180");
17 shouldBe("rect.width.baseVal.value", "300");
20 function sample4() { // From 8s to 8s
21 shouldBeCloseEnough("rect.width.animVal.value", "30");
22 shouldBe("rect.width.baseVal.value", "300");
25 function executeTest() {
26 rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0];
28 // Sampling according to: values="300;255;180;30" keyTimes="0;.5;.75;1" begin="0s" dur="8s"
29 const expectedValues = [
30 // [animationId, time, sampleCallback]
31 ["an1", 0.0, sample1],
32 ["an1", 3.999, sample2],
33 ["an1", 4.001, sample2],
34 ["an1", 5.999, sample3],
35 ["an1", 6.001, sample3],
36 ["an1", 7.999, sample4],
37 ["an1", 8.001, sample4],
38 ["an1", 60.0, sample4]
41 runAnimationTest(expectedValues);
44 window.animationStartsImmediately = true;
45 var successfullyParsed = true;