Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Side by Side Diff: LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html

Issue 453493002: Improve detection of touch events when hiding media controls. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@autoHideControls
Patch Set: Revert Patch Set 8 Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <style> 3 <style>
4 #no-video-media { 4 #no-video-media {
5 width: 320px; 5 width: 320px;
6 height: 240px; 6 height: 240px;
7 } 7 }
8 </style> 8 </style>
9 <script src=video-test.js></script> 9 <script src=video-test.js></script>
10 <script src=media-file.js></script> 10 <script src=media-file.js></script>
11 <script src=media-controls.js></script> 11 <script src=media-controls.js></script>
12 <script> 12 <script>
13 var controls; 13 var controls;
14 14
15 function runTest() 15 function runTest()
16 { 16 {
17 video = document.getElementById("no-video-media"); 17 video = document.getElementById("no-video-media");
18 18
19 testExpected("video.paused", true); 19 testExpected("video.paused", true);
20 if (!window.testRunner) 20 if (!window.testRunner)
21 return; 21 return;
22 22
23 // Click the play button. 23 // Tap (touch input) the play button.
24 var playCoords = mediaControlsButtonCoordinates(video, "play-button"); 24 var coords = mediaControlsButtonCoordinates(video, "play-button");
25 var clickX = playCoords[0]; 25 eventSender.gestureTapDown(coords[0], coords[1]);
26 var clickY = playCoords[1]; 26 eventSender.gestureShowPress(coords[0], coords[1]);
27 eventSender.mouseMoveTo(clickX, clickY); 27 eventSender.gestureTap(coords[0], coords[1]);
28 eventSender.mouseDown();
29 eventSender.mouseUp();
30 testExpected("video.paused", false); 28 testExpected("video.paused", false);
31 29
30 // And then hover the control with the mouse.
31 eventSender.mouseMoveTo(coords[0], coords[1]);
32
33 // And the controls should remain visible.
32 runAfterHideMediaControlsTimerFired(function() 34 runAfterHideMediaControlsTimerFired(function()
33 { 35 {
34 controls = mediaControlsButton(video, "panel"); 36 controls = mediaControlsButton(video, "panel");
35 testExpected("getComputedStyle(controls).opacity", 1); 37 testExpected("getComputedStyle(controls).opacity", 1);
36
37 consoleWrite("");
38 endTest(); 38 endTest();
39 }, video); 39 }, video);
40 } 40 }
41 </script> 41 </script>
42 <body> 42 <body>
43 <p>Test video element control visibility after click on control. After the c lick 43 <p>Test video element control visibility with multimodal input. The controls
44 the mouse does not move, so the control is still hovered and it should 44 should remain visible if the last input event was a mouse move over them. </p>
45 remain visible.</p>
46 <p>This test only runs in DRT!</p> 45 <p>This test only runs in DRT!</p>
47 46
48 <video id="no-video-media" controls loop oncanplaythrough="runTest()"></vide o> 47 <video id="no-video-media" controls loop oncanplaythrough="runTest()"></vide o>
49 <script> 48 <script>
50 setSrcById("no-video-media", findMediaFile("video", "content/test")); 49 setSrcById("no-video-media", findMediaFile("video", "content/test"));
51 </script> 50 </script>
52 </body> 51 </body>
53 </html> 52 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698