Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / media / video-timeupdate-during-playback.html
blob225aa0f39ae818a3ad09367e0eceeaa948302d1c
1 <html>
2 <body>
4 <video controls></video>
6 <p>
7 Test 'timeupdate' events are posted while playing but not while paused.
8 </p>
9 <script src=media-file.js></script>
10 <script src=video-test.js></script>
11 <script>
12 setSrcByTagName("video", findMediaFile("video", "content/test"));
14 var timeupdateEventCount = 0;
15 var countWhilePlaying = 0;
17 function someTimeLater()
19 if (countWhilePlaying != timeupdateEventCount)
20 failTest("'timeupdate' events posted after pausing");
21 endTest();
24 function pause()
26 countWhilePlaying = timeupdateEventCount;
27 setTimeout(someTimeLater, 400) ;
28 consoleWrite("");
31 function playing()
33 setTimeout(function () { run("video.pause()"); }, 500) ;
34 consoleWrite("");
37 mediaElement.addEventListener("timeupdate", function () { ++timeupdateEventCount; });
39 waitForEvent('error');
40 waitForEvent("loadstart");
41 waitForEvent("waiting");
42 waitForEvent("ratechange");
43 waitForEvent("durationchange");
44 waitForEvent("loadedmetadata");
45 waitForEvent("loadeddata");
46 waitForEvent("canplay");
47 waitForEvent("pause", pause);
48 waitForEvent("play");
49 waitForEvent("playing", playing);
51 run("video.play()");
52 consoleWrite("");
53 </script>
55 </body>
56 </html>