Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / animations / script-tests / animate-elem-03-t-drt.js
blob7dabd26066315451563677fa0d5c0a7418acf5a3
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-03-t.svg");
4 function parseFontSizeFromString() {
5 fontSizeString = getComputedStyle(text).fontSize;
6 return fontSizeString.replace(/px$/, "");
9 // Setup animation test
10 function sample1() {
11 shouldBeCloseEnough("parseFontSizeFromString()", "40");
12 expectFillColor(text, 0, 0, 255);
15 function sample2() {
16 shouldBeCloseEnough("parseFontSizeFromString()", "60");
17 expectFillColor(text, 0, 59, 128);
20 function sample3() {
21 shouldBeCloseEnough("parseFontSizeFromString()", "80");
22 expectFillColor(text, 0, 119, 0);
25 function executeTest() {
26 text = rootSVGElement.ownerDocument.getElementsByTagName("text")[2];
28 const expectedValues = [
29 // [animationId, time, sampleCallback]
30 ["an1", 0.0, sample1],
31 ["an1", 3.0, sample2],
32 ["an1", 6.0, sample3],
33 ["an1", 60.0, sample3]
36 runAnimationTest(expectedValues);
39 window.animationStartsImmediately = true;
40 var successfullyParsed = true;