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

Side by Side Diff: LayoutTests/media/video-controls-visible-exiting-fullscreen.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, 7 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 <html> 1 <html>
2 <head> 2 <head>
3 <title>Test rendering of video control after exiting fullscreen</title> 3 <title>Test rendering of video control after exiting fullscreen</title>
4 <script src=media-file.js></script> 4 <script src=media-file.js></script>
5 <script src=media-controls.js></script> 5 <script src=media-controls.js></script>
6 <script src=video-test.js></script> 6 <script src=video-test.js></script>
7 <script src=../fullscreen/full-screen-test.js></script> 7 <script src=../fullscreen/full-screen-test.js></script>
8 <script> 8 <script>
9 var panel; 9 var panel;
10 var playButtonCoordinates; 10 var playButtonCoordinates;
11 var fadeoutTime = 3500;
12 var count = 0; 11 var count = 0;
13 12
14 function init() 13 function init()
15 { 14 {
16 findMediaElement(); 15 findMediaElement();
17 waitForEvent(video, 'canplaythrough', oncanplaythrough); 16 waitForEvent(video, 'canplaythrough', oncanplaythrough);
18 video.src = findMediaFile('video', 'content/test'); 17 video.src = findMediaFile('video', 'content/test');
19 } 18 }
20 19
21 function oncanplaythrough() 20 function oncanplaythrough()
22 { 21 {
23 waitForEvent(video, 'webkitfullscreenchange', onfullscreenchange); 22 waitForEvent(video, 'webkitfullscreenchange', onfullscreenchange);
24 23
25 panel = mediaControlsElement(internals.shadowRoot(video).firstChild, "-webkit-media-controls-panel"); 24 panel = mediaControlsButton(video, "panel");
26 if (window.eventSender) { 25 if (window.eventSender) {
27 try { 26 try {
28 playButtonCoordinates = mediaControlsButtonCoordinates(video , "play-button"); 27 playButtonCoordinates = mediaControlsButtonCoordinates(video , "play-button");
29 } catch (exception) { 28 } catch (exception) {
30 testRunner.notifyDone(); 29 testRunner.notifyDone();
31 return; 30 return;
32 } 31 }
33 var x = playButtonCoordinates[0]; 32 var x = playButtonCoordinates[0];
34 var y = playButtonCoordinates[1]; 33 var y = playButtonCoordinates[1];
35 34
36 consoleWrite("** Move mouse to the play button and start playing the video **"); 35 consoleWrite("** Move mouse to the play button and start playing the video **");
37 eventSender.mouseMoveTo(x, y); 36 eventSender.mouseMoveTo(x, y);
38 eventSender.mouseDown(); 37 eventSender.mouseDown();
39 eventSender.mouseUp(); 38 eventSender.mouseUp();
40 consoleWrite(""); 39 consoleWrite("");
41 } 40 }
42 41
43 consoleWrite("** Test that controls are shown when controls attribut e is present **"); 42 consoleWrite("** Test that controls are shown when controls attribut e is present **");
44 var opacity = getComputedStyle(panel).opacity; 43 var opacity = getComputedStyle(panel).opacity;
45 if (opacity < 1) 44 if (opacity < 1)
46 failTest("Media control is not opaque."); 45 failTest("Media control is not opaque.");
47 else 46 else
48 runWithKeyDown(function(){ video.webkitRequestFullscreen(); }); 47 runWithKeyDown(function(){ video.webkitRequestFullscreen(); });
49 } 48 }
50 49
51 function onfullscreenchange() 50 function onfullscreenchange()
52 { 51 {
53 switch (count) { 52 switch (count) {
54 case 0: 53 case 0:
55 setTimeout(continueTest, fadeoutTime); 54 runAfterControlsHidden(continueTest, video);
56 break; 55 break;
57 case 1: 56 case 1:
58 consoleWrite(""); 57 consoleWrite("");
59 consoleWrite("** The controls should be shown after exiting the fullscreen"); 58 consoleWrite("** The controls should be shown after exiting the fullscreen");
60 var opacity = getComputedStyle(panel).opacity; 59 var opacity = getComputedStyle(panel).opacity;
61 if (opacity < 1) 60 if (opacity < 1)
62 failTest("Media control is not opaque."); 61 failTest("Media control is not opaque.");
63 else 62 else
64 endTest(); 63 endTest();
65 } 64 }
66 count++; 65 count++;
67 } 66 }
68 67
69 function continueTest() 68 function continueTest()
70 { 69 {
71 consoleWrite(""); 70 consoleWrite("");
72 run("document.webkitExitFullscreen()"); 71 run("document.webkitExitFullscreen()");
73 } 72 }
74 73
75 </script> 74 </script>
76 </head> 75 </head>
77 <body onload="init()"> 76 <body onload="init()">
78 Tests that video controls are shwon after exiting fullscreen<br> 77 Tests that video controls are shwon after exiting fullscreen<br>
79 <video controls></video> 78 <video controls></video>
80 </body> 79 </body>
81 </html> 80 </html>
82 81
OLDNEW
« no previous file with comments | « LayoutTests/media/video-controls-toggling.html ('k') | Source/core/html/shadow/MediaControlElements.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698