OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <title>Test that seeking attribute is true immediately after a seek |
| 5 to the current position, and goes back to false when the seek comple
tes.</title> |
| 6 |
| 7 <script src="media-file.js"></script> |
| 8 <script src="video-test.js"></script> |
| 9 <script> |
| 10 var video; |
| 11 var seekedCount = 0; |
| 12 var seekTime = 1; |
| 13 |
| 14 function onload() |
| 15 { |
| 16 video = document.querySelector("video"); |
| 17 video.src = findMediaFile("video", "content/test"); |
| 18 waitForEventOnce('loadedmetadata', loadedmetadata); |
| 19 waitForEvent('seeking'); |
| 20 waitForEvent('seeked', seeked); |
| 21 } |
| 22 |
| 23 function loadedmetadata() |
| 24 { |
| 25 run("video.currentTime = seekTime"); |
| 26 testExpected("video.seeking", true); |
| 27 consoleWrite(""); |
| 28 } |
| 29 |
| 30 function seeked() |
| 31 { |
| 32 ++seekedCount; |
| 33 consoleWrite(""); |
| 34 |
| 35 testExpected("video.seeking", false); |
| 36 testExpected("video.currentTime", seekTime); |
| 37 |
| 38 if (seekedCount == 2) { |
| 39 endTest(); |
| 40 return; |
| 41 } |
| 42 |
| 43 run("video.currentTime = seekTime"); |
| 44 testExpected("video.seeking", true); |
| 45 |
| 46 consoleWrite(""); |
| 47 } |
| 48 </script> |
| 49 </head> |
| 50 <body onload="onload()"> |
| 51 <p>Test that seeking attribute is true immediately after a seek |
| 52 to the current position, and goes back to false when the seek completes.
</p> |
| 53 <video></video> |
| 54 </body> |
| 55 </html> |
OLD | NEW |