Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / media / video-controls-visibility-multimodal-touch-after-mouse.html
bloba4296584a582f6d2cf6c026d5036d6d607bf7078
1 <!DOCTYPE html>
2 <html>
3 <style>
4 #no-video-media {
5 width: 320px;
6 height: 240px;
8 </style>
9 <script src=video-test.js></script>
10 <script src=media-file.js></script>
11 <script src=media-controls.js></script>
12 <script>
13 var controls;
15 function runTest()
17 video = document.getElementById("no-video-media");
19 testExpected("video.paused", true);
20 if (!window.testRunner)
21 return;
23 if (!window.internals || !window.internals.setIsCursorVisible) {
24 debug("window.internals.setIsCursorVisible is required to run this test.");
25 return;
28 // Hover the control with the mouse.
29 var coords = mediaControlsButtonCoordinates(video, "play-button");
30 eventSender.mouseMoveTo(coords[0], coords[1]);
32 // And then tap (touch input) the play button.
33 eventSender.gestureTapDown(coords[0], coords[1]);
34 eventSender.gestureShowPress(coords[0], coords[1]);
35 eventSender.gestureTap(coords[0], coords[1]);
36 testExpected("video.paused", false);
38 // In the real world Chromium hides the cursor after a tap,
39 // so hide it manually here. This is required to hit the
40 // early out from EventHandler::fakeMouseMoveEventTimerFired when
41 // isCursorVisible is false.
42 internals.setIsCursorVisible(document, false);
44 // And the controls should hide after a timeout.
45 runAfterHideMediaControlsTimerFired(function()
47 controls = mediaControlsButton(video, "panel");
48 testExpected("getComputedStyle(controls).opacity", 0);
49 endTest();
50 }, video);
53 </script>
54 <body>
55 <p>Test video element control visibility with multimodal input. The controls
56 should hide after a timeout if the last input event was a tap.</p>
57 <p>This test only runs in DRT!</p>
59 <video id="no-video-media" controls loop oncanplaythrough="runTest()"></video>
60 <script>
61 setSrcById("no-video-media", findMediaFile("video", "content/test"));
62 </script>
63 </body>
64 </html>