Default mouse cursor behavior should be auto-hide for full screen video with custom...
[WebKit-https.git] / LayoutTests / fullscreen / video-controls-override.html
1 <body>
2     <p>This tests that the video element's "controls" attribute is overridden in full screen mode, and that the controls are correctly hidden upon exiting full screen.  Press any key to continue.</p>
3     <video id="video" width="300"></video>
4     <script src="full-screen-test.js"></script>
5     <script src="../media/media-controls.js"></script>
6     <script>
7         var callback;
8         var shadowRoot;
9         var panel;
10
11         var fullscreenChanged = function(event)
12         {
13             if (callback)
14                 callback(event)
15         };
16         waitForEvent(document, 'webkitfullscreenchange', fullscreenChanged);
17
18         var video = document.getElementById('video');
19
20         var videoEnteredFullScreen = function() {
21             if (window.internals) {
22                 testExpected("shadowRoot = internals.shadowRoot(video)", null, "!=");
23                 testExpected("panel = mediaControlsElement(shadowRoot.firstChild, '-webkit-media-controls-panel')", null, "!=");
24                 testExpected("internals.shadowPseudoId(panel)", "-webkit-media-controls-panel");
25                 testExpected("document.defaultView.getComputedStyle(panel)['display']", 'none', "!=");
26                 testExpected("document.defaultView.getComputedStyle(panel)['height']", '20px', ">=");
27             }
28             else
29                 logResult(false, "window.internals == undefined");
30             
31             callback = cancelledFullScreen;
32             document.webkitCancelFullScreen();
33         };
34
35         var cancelledFullScreen = function() {
36             if (window.testRunner)
37                 testExpected("document.defaultView.getComputedStyle(panel)['display']", 'none');
38             else
39                 logResult(false, "window.testRunner == undefined");
40
41             endTest();
42         };
43
44         callback = videoEnteredFullScreen;
45         runWithKeyDown(function(){video.webkitRequestFullScreen()});
46     </script>
47 </body>