[Modern Media Controls] Turn media/modern-media-controls/ios-inline-media-controls...
[WebKit-https.git] / LayoutTests / media / controls-right-click-on-timebar.html
1 <!-- webkit-test-runner [ enableModernMediaControls=false ] -->
2 <html>
3     <head>
4         <title>right click on timebar test</title>
5         <script src=media-controls.js></script>
6         <script src=media-file.js></script>
7         <script src=video-test.js></script>
8         <script>
9             if (window.testRunner)
10                 testRunner.dumpAsText();
11
12             function click()
13             {
14                 if (window.eventSender) {
15                     var seekCoords;
16                     try {
17                         seekCoords = mediaControlsButtonCoordinates(video, "timeline");
18                     } catch (exception) {
19                         failTest(exception.description);
20                         return;
21                     }
22                     var x = seekCoords[0];
23                     var y = seekCoords[1];
24
25                     eventSender.mouseMoveTo(x, y);
26                     eventSender.contextClick();
27                 }
28                 window.setTimeout("endTest()", 200);
29             }
30
31             function playing()
32             {
33                 window.setTimeout("click()", 100);
34             }
35
36             function seeked()
37             {
38                 failTest("Should not seek.");
39             }
40
41             function start()
42             {
43                 findMediaElement();
44                 waitForEvent('playing', playing);
45                 waitForEvent('seeked', seeked);
46                 run("video.autoplay = true");
47                 disableFullTestDetailsPrinting();
48                 runSilently("video.src = '" + findMediaFile("video", "content/test") + "'");
49                 enableFullTestDetailsPrinting();
50             }    
51         </script>
52     </head>
53
54     <body onload="start()">
55     <p>Test that right clicking on the timebar does not cause a seek.</p>
56     <video controls></video>
57     </body>
58 </html>