OLD | NEW |
1 <body> | 1 <body> |
2 <script src="full-screen-test.js"></script> | 2 <script src="full-screen-test.js"></script> |
3 <div><span></span></div> | 3 <div><span></span></div> |
4 <script> | 4 <script> |
5 // Bail out early if the full screen API is not enabled or is missing: | 5 var callback; |
6 if (Element.prototype.webkitRequestFullScreen == undefined) { | 6 var fullscreenChanged = function(event) |
7 logResult(false, "Element.prototype.webkitRequestFullScreen == undefined
"); | 7 { |
| 8 if (callback) |
| 9 callback(event) |
| 10 }; |
| 11 waitForEvent(document, 'webkitfullscreenchange', fullscreenChanged); |
| 12 |
| 13 var span = document.getElementsByTagName('span')[0]; |
| 14 |
| 15 var spanEnteredFullScreen = function(event) { |
| 16 callback = spanExitedFullScreen; |
| 17 testExpected("document.webkitCurrentFullScreenElement", span); |
| 18 span.parentNode.removeChild(span); |
| 19 }; |
| 20 |
| 21 var spanExitedFullScreen = function(event) { |
| 22 callback = null; |
| 23 testExpected("document.webkitCurrentFullScreenElement", null); |
8 endTest(); | 24 endTest(); |
9 } else { | 25 }; |
10 var callback; | 26 |
11 var fullscreenChanged = function(event) | 27 callback = spanEnteredFullScreen; |
12 { | 28 runWithKeyDown(function(){span.webkitRequestFullScreen()}); |
13 if (callback) | |
14 callback(event) | |
15 }; | |
16 waitForEvent(document, 'webkitfullscreenchange', fullscreenChanged); | |
17 | |
18 var span = document.getElementsByTagName('span')[0]; | |
19 | |
20 var spanEnteredFullScreen = function(event) { | |
21 callback = spanExitedFullScreen; | |
22 testExpected("document.webkitCurrentFullScreenElement", span); | |
23 span.parentNode.removeChild(span); | |
24 }; | |
25 | |
26 var spanExitedFullScreen = function(event) { | |
27 callback = null; | |
28 testExpected("document.webkitCurrentFullScreenElement", null); | |
29 endTest(); | |
30 }; | |
31 | |
32 callback = spanEnteredFullScreen; | |
33 runWithKeyDown(function(){span.webkitRequestFullScreen()}); | |
34 } | |
35 </script> | 29 </script> |
OLD | NEW |