2 <!--This tests svg.getCurrentTime() when SVG animation is paused and unpaused.
4 1. Pause the SVG animation at the beginning.
6 3. Test 1, measure the currentTime which should still be 0.
7 4. Unpause the SVG animation
9 6. Test 2, measure the currentTime which should be .05 sec.
10 7. Pause the SVG animation
12 9. Test 3, measure the currentTime which should still be .05 sec.
15 <script src=
"../../resources/js-test.js"></script>
16 <script src=
"resources/SVGAnimationTestCase.js"></script>
19 if (window
.testRunner
) {
20 testRunner
.dumpAsText();
21 testRunner
.waitUntilDone();
24 svg
= document
.getElementById("svg");
25 rect
= document
.getElementById("rect");
27 svg
.pauseAnimations();
28 setTimeout(function() {
29 shouldBeCloseEnough("svg.getCurrentTime()", "0", 0.01);
30 svg
.unpauseAnimations();
31 setTimeout(function() {
32 shouldBeCloseEnough("svg.getCurrentTime()", "0.05", 0.02);
33 svg
.pauseAnimations();
34 setTimeout(function() {
35 shouldBeCloseEnough("svg.getCurrentTime()", "0.05", 0.02);
36 if (window
.testRunner
)
37 testRunner
.notifyDone();
43 <head><title>svg.getCurrentTime() when SVG animation is paused and unpaused
</title></head>
44 <body onload=
"load()">
45 <svg id=
"svg" xmlns=
"http://www.w3.org/2000/svg">
46 <rect id=
"rect" fill=
"green" width=
"20" height=
"20">
47 <animate attributeName=
"x" from=
"0" to=
"200" begin=
"0s" dur=
"3s"></animate>