Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / animations / script-tests / svglength-additive-by-6.js
blob176c3b27dd4d70902d091452e4a981c421d29ad4
1 description("This tests by-animations adding to previous underlying values");
2 embedSVGTestCase("resources/svglength-additive-by-6.svg");
4 // Setup animation test
5 function sample1() {
6 shouldBeCloseEnough("rect.width.animVal.value", "10");
7 shouldBe("rect.width.baseVal.value", "10");
10 function sample2() {
11 shouldBeCloseEnough("rect.width.animVal.value", "30");
12 shouldBe("rect.width.baseVal.value", "10");
15 function sample3() {
16 shouldBeCloseEnough("rect.width.animVal.value", "50");
17 shouldBe("rect.width.baseVal.value", "10");
20 function sample4() {
21 shouldBeCloseEnough("rect.width.animVal.value", "10");
22 shouldBe("rect.width.baseVal.value", "10");
25 function sample5() {
26 shouldBeCloseEnough("rect.width.animVal.value", "55");
27 shouldBe("rect.width.baseVal.value", "10");
30 function sample6() {
31 shouldBeCloseEnough("rect.width.animVal.value", "100");
32 shouldBe("rect.width.baseVal.value", "10");
35 function executeTest() {
36 rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0];
38 const expectedValues = [
39 // [animationId, time, sampleCallback]
40 ["an1", 0.0, sample1],
41 ["an1", 2.0, sample2],
42 ["an1", 3.999, sample3],
43 ["an1", 4.001, sample4],
44 ["an1", 7.0, sample5],
45 ["an1", 9.0, sample6],
46 ["an1", 60.0, sample6]
49 runAnimationTest(expectedValues);
52 window.animationStartsImmediately = true;
53 var successfullyParsed = true;