OLD | NEW |
1 <body> | 1 <body> |
2 <script src="full-screen-test.js"></script> | 2 <script src="full-screen-test.js"></script> |
3 <span></span> | 3 <span></span> |
4 <script> | 4 <script> |
5 var span = document.getElementsByTagName('span')[0]; | 5 var span = document.getElementsByTagName('span')[0]; |
6 | 6 |
7 var documentEnteredFullScreen = function() { | 7 var documentEnteredFullScreen = function() { |
8 testExpected("document.webkitCurrentFullScreenElement", document.documen
tElement); | 8 testExpected("document.webkitCurrentFullScreenElement", document.documen
tElement); |
9 runWithKeyDown(function(){document.documentElement.webkitRequestFullscre
en()}); | |
10 waitForEvent(document, 'webkitfullscreenerror', documentDidNotReenterFul
lScreen, false, true); | |
11 }; | |
12 | |
13 var documentDidNotReenterFullScreen = function() { | |
14 testExpected("document.webkitCurrentFullScreenElement", document.documen
tElement); | |
15 runWithKeyDown(function(){span.webkitRequestFullscreen()}); | 9 runWithKeyDown(function(){span.webkitRequestFullscreen()}); |
16 waitForEvent(document, 'webkitfullscreenchange', spanEnteredFullScreen,
false, true); | 10 waitForEvent(document, 'webkitfullscreenchange', spanEnteredFullScreen,
false, true); |
17 }; | 11 }; |
18 | 12 |
19 var spanEnteredFullScreen = function() { | 13 var spanEnteredFullScreen = function() { |
20 testExpected("document.webkitCurrentFullScreenElement", span); | 14 testExpected("document.webkitCurrentFullScreenElement", span); |
21 runWithKeyDown(function(){span.webkitRequestFullscreen()}); | |
22 waitForEvent(document, 'webkitfullscreenerror', spanDidNotReenterFullScr
een, false, true); | |
23 }; | |
24 | |
25 var spanDidNotReenterFullScreen = function() { | |
26 testExpected("document.webkitCurrentFullScreenElement", span); | |
27 waitForEvent(document, 'webkitfullscreenchange', spanExited, false, true
); | 15 waitForEvent(document, 'webkitfullscreenchange', spanExited, false, true
); |
28 document.webkitExitFullscreen(); | 16 document.webkitExitFullscreen(); |
29 }; | 17 }; |
30 | 18 |
31 var spanExited = function() { | 19 var spanExited = function() { |
32 testExpected("document.webkitCurrentFullScreenElement", document.documen
tElement); | 20 testExpected("document.webkitCurrentFullScreenElement", document.documen
tElement); |
33 waitForEvent(document, 'webkitfullscreenchange', documentExited, false,
true); | 21 waitForEvent(document, 'webkitfullscreenchange', documentExited, false,
true); |
34 document.webkitExitFullscreen(); | 22 document.webkitExitFullscreen(); |
35 }; | 23 }; |
36 | 24 |
37 var documentExited = function() { | 25 var documentExited = function() { |
38 testExpected("document.webkitCurrentFullScreenElement", undefined); | 26 testExpected("document.webkitCurrentFullScreenElement", undefined); |
39 endTest(); | 27 endTest(); |
40 }; | 28 }; |
41 | 29 |
42 runWithKeyDown(function(){document.documentElement.webkitRequestFullscreen()
}); | 30 runWithKeyDown(function(){document.documentElement.webkitRequestFullscreen()
}); |
43 waitForEvent(document, 'webkitfullscreenchange', documentEnteredFullScreen,
false, true); | 31 waitForEvent(document, 'webkitfullscreenchange', documentEnteredFullScreen,
false, true); |
44 </script> | 32 </script> |
OLD | NEW |