upload tizen1.0 source
[framework/web/webkit-efl.git] / LayoutTests / media / video-does-not-loop.html
1 <!DOCTYPE html>
2 <html>
3     <head>
4         <style> video { height: 25px; width: 300px; } </style>
5         <script src=video-test.js></script>
6     
7         <script>
8             var seekCount = 0;
9     
10             function loadedmetadata()
11             {
12                 consoleWrite("<br><em>++ seek to near the end to reduce test time.</em>");
13                 run("video.currentTime = video.duration - 0.4");
14             }
15
16             function seeked()
17             {
18                 if (++seekCount == 1)
19                 {
20                     consoleWrite("<br><em>++ seek completed, beginning playback.</em>");
21                     testExpected("video.paused", true);
22                     testExpected("video.ended", false);
23                     run("video.play()");
24                     consoleWrite("");
25                 }
26             }
27     
28             function ended() 
29             {
30                 consoleWrite("<br><em>++ played to end and stopped.</em>");
31                 testExpected("video.ended", true);
32
33                 // don't use "testExpected()" so we won't log the actual duration as the floating point result may differ with different engines
34                 reportExpected(mediaElement.currentTime == mediaElement.duration, "mediaElement.currentTime", "==", "mediaElement.duration", mediaElement.currentTime);
35
36                 consoleWrite("");
37                 endTest();
38             }
39     
40             function start()
41             {
42                 findMediaElement();
43
44                 consoleWrite("<em>++ Test initial state.</em>");
45                 testExpected("video.loop", false);
46             
47                 waitForEvent('pause');
48                 waitForEvent("ended", ended);
49                 waitForEvent("seeked", seeked);
50                 waitForEvent("loadedmetadata", loadedmetadata);
51
52                 video.src = "content/silence-loop.mov";
53             }
54         </script>
55
56     </head>
57     <body>
58         <video controls ></video>
59         <p>Test to make sure QuickTime movie saved with 'loop' user data does not loop automatically.</p>
60         <script>start()</script>
61     </body>
62 </html>