2 <script src=
"full-screen-test.js"></script>
6 var fullscreenChanged = function(event
)
11 waitForEvent(document
, 'webkitfullscreenchange', fullscreenChanged
);
13 var span
= document
.getElementsByTagName('span')[0];
15 var spanEnteredFullScreen = function() {
16 testExpected("document.webkitIsFullScreen", true);
17 testExpected("document.webkitCurrentFullScreenElement", span
);
18 callback
= cancelledFullScreen
;
19 document
.webkitCancelFullScreen();
22 var cancelledFullScreen = function() {
23 testExpected("document.webkitIsFullScreen", false);
24 testExpected("document.webkitCurrentFullScreenElement", undefined);
25 callback
= failFullScreenTest
;
26 document
.webkitCancelFullScreen();
27 setTimeout(endTest
, 0);
30 var failFullScreenTest = function() {
31 consoleWrite("Should not have received a webkitfullscreenchange event.");
35 callback
= spanEnteredFullScreen
;
36 runWithKeyDown(function(){span
.webkitRequestFullScreen()});