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

Side by Side Diff: LayoutTests/media/video-controls-auto-hide-after-play-by-touch.html

Issue 892963003: Ensure media control goes to transparent(hide) after seek by touch (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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
13 var controls; 14 var controls;
14 15
16 function dispatchActivateEvent(target) {
17 // Create a DOMActivate event and dispatch it
18 var event = document.createEvent('UIEvents');
19 event.initUIEvent('DOMActivate', true, true, window, 1)
20 target.dispatchEvent(event);
fs 2015/02/06 17:04:37 Nit: Align/indent to same column as the two lines
21 }
22
23
15 function runTest() 24 function runTest()
16 { 25 {
17 video = document.getElementById("no-video-media"); 26 video = document.getElementById("no-video-media");
27 controls = mediaControlsButton(video, "panel");
18 28
19 testExpected("video.paused", true); 29 testExpected("video.paused", true);
20 if (!window.testRunner) 30 if (!window.testRunner)
21 return; 31 return;
22 32
23 // Click the play button. 33 // Click the play button.
24 var playCoords = mediaControlsButtonCoordinates(video, "play-button"); 34 var playCoords = mediaControlsButtonCoordinates(video, "play-button");
25 var clickX = playCoords[0]; 35 var clickX = playCoords[0];
26 var clickY = playCoords[1]; 36 var clickY = playCoords[1];
27 eventSender.mouseMoveTo(clickX, clickY); 37 eventSender.gestureTap(clickX, clickY);
28 eventSender.mouseDown(); 38 eventSender.gestureTapDown(clickX, clickY);
29 eventSender.mouseUp(); 39 dispatchActivateEvent(controls);
40
30 testExpected("video.paused", false); 41 testExpected("video.paused", false);
31 42
32 runAfterHideMediaControlsTimerFired(function() 43 runAfterHideMediaControlsTimerFired(function()
33 { 44 {
34 controls = mediaControlsButton(video, "panel");
35 testExpected("getComputedStyle(controls).opacity", 0); 45 testExpected("getComputedStyle(controls).opacity", 0);
36 46
37 consoleWrite(""); 47 consoleWrite("");
38 endTest(); 48 endTest();
39 }, video); 49 }, video);
40
41 // Move the mouse to the upper-left corner of the video.
42 eventSender.mouseMoveTo(video.offsetLeft + 4, video.offsetTop + 4);
43 } 50 }
44 </script> 51 </script>
45 <body> 52 <body>
46 <p>Test video element control visibility when mouse is not over element.</p> 53 <p>Test video control element visibility when play by touch.</p>
47 <p>This test only runs in DRT!</p> 54 <p>This test only runs in DRT!</p>
48 55
49 <video id="no-video-media" controls loop oncanplaythrough="runTest()"></vide o> 56 <video id="no-video-media" controls loop oncanplaythrough="runTest()"></vide o>
50 <script> 57 <script>
51 setSrcById("no-video-media", findMediaFile("video", "content/test")); 58 setSrcById("no-video-media", findMediaFile("video", "content/test"));
52 </script> 59 </script>
53 </body> 60 </body>
54 </html> 61 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698