63 lines
1.9 KiB
HTML
63 lines
1.9 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
|
<html>
|
|
<head>
|
|
<script src="../../resources/js-test-pre.js"></script>
|
|
<script src="../dynamic-updates/resources/SVGTestCase.js"></script>
|
|
<script src="resources/SVGAnimationTestCase.js"></script>
|
|
</head>
|
|
<body onload="runSMILTest()">
|
|
<h1>SVG 1.1 dynamic animation tests</h1>
|
|
<p id="description"></p>
|
|
<div id="console"></div>
|
|
<script>
|
|
description("A copy of the corresponding W3C-SVG-1.1 test, which dumps the animation at certain times");
|
|
embedSVGTestCase("../W3C-SVG-1.1/animate-elem-18-t.svg");
|
|
|
|
// Setup animation test
|
|
function sample1() { // From 0s to 2s
|
|
shouldBeCloseEnough("rect.width.animVal.value", "300");
|
|
shouldBe("rect.width.baseVal.value", "300");
|
|
}
|
|
|
|
function sample2() { // From 2s to 6s
|
|
shouldBeCloseEnough("rect.width.animVal.value", "255");
|
|
shouldBe("rect.width.baseVal.value", "300");
|
|
}
|
|
|
|
function sample3() { // From 6s to 8s
|
|
shouldBeCloseEnough("rect.width.animVal.value", "180");
|
|
shouldBe("rect.width.baseVal.value", "300");
|
|
}
|
|
|
|
function sample4() { // From 8s to 10s
|
|
shouldBeCloseEnough("rect.width.animVal.value", "30");
|
|
shouldBe("rect.width.baseVal.value", "300");
|
|
}
|
|
|
|
function executeTest() {
|
|
rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0];
|
|
|
|
// Sampling according to: keyTimes="0;.2;.6;.8" begin="0s" dur="10s"
|
|
const expectedValues = [
|
|
// [animationId, time, sampleCallback]
|
|
["an1", 0.0, sample1],
|
|
["an1", 1.999, sample1],
|
|
["an1", 2.001, sample2],
|
|
["an1", 5.999, sample2],
|
|
["an1", 6.001, sample3],
|
|
["an1", 7.999, sample3],
|
|
["an1", 8.001, sample4],
|
|
["an1", 9.999, sample4],
|
|
["an1", 10.001, sample4],
|
|
["an1", 60.0, sample4]
|
|
];
|
|
|
|
runAnimationTest(expectedValues);
|
|
}
|
|
|
|
window.animationStartsImmediately = true;
|
|
var successfullyParsed = true;
|
|
</script>
|
|
</body>
|
|
</html>
|