[Modern Media Controls] Turn media/modern-media-controls/ios-inline-media-controls...
[WebKit-https.git] / LayoutTests / media / media-controls-timeline-updates.html
1 <!DOCTYPE html><!-- webkit-test-runner [ enableModernMediaControls=false ] -->
2 <html>
3     <head>
4         <script src=media-file.js></script>
5         <script src=video-test.js></script>
6         <script src=media-controls.js></script>
7         <script>
8             var video;
9
10             function init()
11             {
12                 findMediaElement();
13                 video.src = findMediaFile("video", "content/test");
14
15                 waitForEvent("canplaythrough", canplaythrough);
16                 waitForEvent("playing", function() { setTimeout(function () {  }, 200); });
17                 waitForEvent("pause", paused);
18                 waitForEventAndFail("error");
19             }
20
21             function timeLineValue()
22             {
23                 var timeline = mediaControlsElement(internals.shadowRoot(video).firstChild.firstChild, '-webkit-media-controls-timeline');
24                 if (!timeline)
25                     throw "Failed to find -webkit-media-controls-timeline";
26
27                 return timeline.value;
28             }
29
30             function paused()
31             {
32                 test("video.currentTime > 0");
33                 test("timeLineValue() > 0");
34
35                 endTest();
36             }
37
38             function canplaythrough()
39             {
40                 if (!window.testRunner)
41                     return;
42
43                 testExpected("timeLineValue()", 0);
44
45                 video.addEventListener("seeked", function() {
46                     video.play();
47                 });
48                 video.fastSeek(video.duration - 1);
49             }
50         </script>
51     </head>
52     <body onload="init()">
53         <p>This tests that media controls timeline updates during playback.</p>
54         <p>This test only runs in DRT!</p>
55         <video controls></video>
56     </body>
57 </html>