Use testRunner instead of layoutTestController in tests still found to be using layou...
[WebKit-https.git] / LayoutTests / fullscreen / full-screen-remove-children.html
1 <body>
2 <script src="full-screen-test.js"></script>
3 <div><span></span></div>
4 <script>
5     // Bail out early if the full screen API is not enabled or is missing:
6     if (Element.prototype.webkitRequestFullScreen == undefined) {
7         logResult(false, "Element.prototype.webkitRequestFullScreen == undefined");
8         endTest();
9     } else {
10         var callback;
11         var fullscreenChanged = function(event)
12         {
13             if (callback)
14                 callback(event)
15         };
16         waitForEvent(document, 'webkitfullscreenchange', fullscreenChanged);
17
18         var span = document.getElementsByTagName('span')[0];
19         var div = span.parentNode;
20
21         var spanEnteredFullScreen = function(event) {
22             callback = spanExitedFullScreen;
23             testExpected("document.webkitCurrentFullScreenElement", span);
24             div.innerHTML = "";
25         };
26
27         var spanExitedFullScreen = function(event) {
28             callback = null;
29             testExpected("document.webkitCurrentFullScreenElement", null);
30             endTest();
31         };
32
33         callback = spanEnteredFullScreen;
34         runWithKeyDown(function(){span.webkitRequestFullScreen()});
35     }
36 </script>