Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / media / controls-timeline-with-controller.html
blob8bc4eff094cf5e63d1a4a95f6347a2191434878d
1 <!doctype html>
2 <html>
3 <head>
4 <title>media controls timeline with MediaController</title>
5 <script src="media-file.js"></script>
6 <script src="media-controls.js"></script>
7 <script src="video-test.js"></script>
8 </head>
9 <body>
10 <video controls></video>
11 <script>
12 findMediaElement();
13 video.controller = new MediaController();
14 video.src = findMediaFile("video", "content/test");
15 waitForEvent("loadedmetadata", function()
17 testExpected("video.controller.currentTime", 0);
18 testExpected("video.currentTime", 0);
19 // Wait for the seek initiated by the "bringing up to speed"
20 // step to complete.
21 waitForEventOnce('seeked', seeked);
22 });
24 var seeked = function() {
25 testExpected("video.seeking", false);
27 // click the middle of the timeline
28 var coords = mediaControlsButtonCoordinates(video, "timeline");
29 eventSender.mouseMoveTo(coords[0], coords[1]);
30 eventSender.mouseDown();
31 eventSender.mouseUp();
33 testExpected("video.controller.currentTime / video.controller.duration", 0.4, '>');
34 testExpected("video.controller.currentTime / video.controller.duration", 0.6, '<');
35 testExpected("video.currentTime / video.duration", 0.4, '>');
36 testExpected("video.currentTime / video.duration", 0.6, '<');
37 testExpected("video.seeking", true);
39 endTest();
41 </script>
42 </body>
43 </html>