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

Side by Side Diff: LayoutTests/media/video-controls-hide-on-move-outside-controls.html

Issue 302603003: Cleanup tests related to controls hiding/fading in/out (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tweaks. Created 6 years, 6 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 | Annotate | Revision Log
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 video.addEventListener("timeupdate", function()
19 {
20 if (video.currentTime < 4)
21 return;
22 controls = mediaControlsButton(video, "panel");
23 testExpected("getComputedStyle(controls).opacity", 0);
24
25 consoleWrite("");
26 endTest();
27 });
28 18
29 testExpected("video.paused", true); 19 testExpected("video.paused", true);
30 if (!window.testRunner) 20 if (!window.testRunner)
31 return; 21 return;
32 22
33 // Click the play button. 23 // Click the play button.
34 var playCoords = mediaControlsButtonCoordinates(video, "play-button"); 24 var playCoords = mediaControlsButtonCoordinates(video, "play-button");
35 var clickX = playCoords[0]; 25 var clickX = playCoords[0];
36 var clickY = playCoords[1]; 26 var clickY = playCoords[1];
37 eventSender.mouseMoveTo(clickX, clickY); 27 eventSender.mouseMoveTo(clickX, clickY);
38 eventSender.mouseDown(); 28 eventSender.mouseDown();
39 eventSender.mouseUp(); 29 eventSender.mouseUp();
40 testExpected("video.paused", false); 30 testExpected("video.paused", false);
41 31
32 runAfterControlsHidden(function()
33 {
34 controls = mediaControlsButton(video, "panel");
35 testExpected("getComputedStyle(controls).opacity", 0);
36
37 consoleWrite("");
38 endTest();
39 }, video);
40
42 // Move the mouse to the upper-left corner of the video. 41 // Move the mouse to the upper-left corner of the video.
43 eventSender.mouseMoveTo(video.offsetLeft + 4, video.offsetTop + 4); 42 eventSender.mouseMoveTo(video.offsetLeft + 4, video.offsetTop + 4);
44 } 43 }
45 </script> 44 </script>
46 <body> 45 <body>
47 <p>Test video element control visibility when mouse is not over element.</p> 46 <p>Test video element control visibility when mouse is not over element.</p>
48 <p>This test only runs in DRT!</p> 47 <p>This test only runs in DRT!</p>
49 48
50 <video id="no-video-media" controls loop oncanplaythrough="runTest()"></vide o> 49 <video id="no-video-media" controls loop oncanplaythrough="runTest()"></vide o>
51 <script> 50 <script>
52 setSrcById("no-video-media", findMediaFile("video", "content/test")); 51 setSrcById("no-video-media", findMediaFile("video", "content/test"));
53 </script> 52 </script>
54 </body> 53 </body>
55 </html> 54 </html>
OLDNEW
« no previous file with comments | « LayoutTests/media/video-controls-focus-movement-on-hide.html ('k') | LayoutTests/media/video-controls-show-on-focus.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698