3 <script src=
"../../resources/js-test.js"></script>
4 <script src=
"resources/SVGAnimationTestCase.js"></script>
7 if (window
.testRunner
) {
8 testRunner
.dumpAsText();
9 testRunner
.waitUntilDone();
12 svg
= document
.getElementById("svg");
13 rect
= document
.getElementById("rect");
15 svg
.pauseAnimations();
17 setTimeout(function() {
18 svg
.setCurrentTime(0.5);
19 shouldBeCloseEnough("svg.getCurrentTime()", "0.5", 0.01);
20 svg
.unpauseAnimations();
21 setTimeout(function() {
22 svg
.setCurrentTime(1);
23 shouldBeCloseEnough("svg.getCurrentTime()", "1", 0.01);
24 svg
.pauseAnimations();
25 setTimeout(function() {
26 svg
.setCurrentTime(2);
27 shouldBeCloseEnough("svg.getCurrentTime()", "2", 0.01);
28 svg
.unpauseAnimations();
29 setTimeout(function() {
30 svg
.setCurrentTime(3.5);
31 shouldBeCloseEnough("svg.getCurrentTime()", "3.5", 0.01);
32 if (window
.testRunner
)
33 testRunner
.notifyDone();
40 <head><title>svg.getCurrentTime() with setCurrentTime() when SVG animation is paused and unpaused
</title></head>
41 <body onload=
"load()">
42 <svg id=
"svg" xmlns=
"http://www.w3.org/2000/svg">
43 <rect id=
"rect" fill=
"green" width=
"20" height=
"20">
44 <animate attributeName=
"x" from=
"0" to=
"200" begin=
"0s" dur=
"3s"></animate>