Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / animations / script-tests / force-use-shadow-tree-recreation-while-animating.js
blob7c00455b085d47efcee2f8c9cbbcb8ae7c81a124
1 description("This test forces use shadow tree recreation while an animating is running");
2 embedSVGTestCase("resources/force-use-shadow-tree-recreation-while-animating.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", "55");
12 shouldBe("rect.width.baseVal.value", "10");
15 function forceUseShadowTreeRecreation() {
16 rect.setAttribute("fill", "green");
19 function sample3() {
20 shouldBeCloseEnough("rect.width.animVal.value", "100");
21 shouldBe("rect.width.baseVal.value", "10");
24 function executeTest() {
25 rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0];
27 const expectedValues = [
28 // [animationId, time, sampleCallback]
29 ["an1", 0.0, sample1],
30 ["an1", 1.999, sample2],
31 ["an1", 2.0, forceUseShadowTreeRecreation],
32 ["an1", 2.001, sample2],
33 ["an1", 4.0, sample3],
34 ["an1", 60.0, sample3],
37 runAnimationTest(expectedValues);
40 window.animationStartsImmediately = true;
41 var successfullyParsed = true;