Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / media / video-seeking.html
blob161ae9b3cd385da2c47f648a8fab1c0a22050e53
1 <video controls></video>
2 <p>Test that seeking attribute is true immediately after a seek,
3 goes back to false when seeking completes, and that a 'seeked' event
4 is fired for each seek
5 </p>
6 <script src=media-file.js></script>
7 <script src=video-test.js></script>
8 <script>
10 var seekedCount = 0;
12 function seeked()
14 ++seekedCount;
15 consoleWrite("");
17 testExpected("video.seeking", false);
18 testExpected("video.currentTime", seekedCount * 0.5);
20 if (seekedCount == 3) {
21 endTest();
22 return;
25 run("video.currentTime = " + (seekedCount + 1) * 0.5);
26 testExpected("video.seeking", true);
28 consoleWrite("");
32 function canplaythrough()
34 if (seekedCount > 0)
35 return;
37 run("video.currentTime = 0.5");
38 consoleWrite("");
41 waitForEvent('waiting' );
42 waitForEvent('seeked', seeked );
43 waitForEventOnce('canplaythrough', canplaythrough);
45 video.src = findMediaFile("video", "content/test");
46 </script>