upload tizen1.0 source
[framework/web/webkit-efl.git] / LayoutTests / media / video-timeupdate-during-playback.html
1 <html>
2 <body>
3     
4     <video controls></video>
5
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"));
13     
14         var timeupdateEventCount = 0;
15         var countWhilePlaying = 0;
16
17         function someTimeLater()
18         {
19             if (countWhilePlaying != timeupdateEventCount)
20                 failTest("'timeupdate' events posted after pausing");
21             endTest();
22         }
23
24         function pause()
25         {
26             countWhilePlaying = timeupdateEventCount;
27             setTimeout(someTimeLater, 400) ;
28             consoleWrite("");
29         }
30         
31         function playing()
32         {
33             setTimeout(function () { run("video.pause()"); }, 500) ;
34             consoleWrite("");
35         }
36
37         mediaElement.addEventListener("timeupdate", function () { ++timeupdateEventCount; });
38
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);
50
51         run("video.play()");
52         consoleWrite("");
53     </script>
54
55 </body>
56 </html>