Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <body> | |
|
falken
2014/08/06 04:18:30
nit: add <!DOCTYPE html>
| |
| 2 <script src="full-screen-test.js"></script> | |
|
falken
2014/08/06 04:18:30
nit: please add a brief description of what the te
| |
| 3 <span></span> | |
| 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 function fullscreenChanged(event) | |
| 12 { | |
| 13 if (callback) | |
| 14 callback(event) | |
| 15 }; | |
| 16 waitForEvent(document, "webkitfullscreenchange", fullscreenChanged); | |
| 17 | |
| 18 var body = document.body; | |
| 19 function bodyEnteredFullScreen() | |
| 20 { | |
| 21 testExpected("document.webkitCurrentFullScreenElement", body); | |
| 22 callback = spanEnteredFullScreen; | |
| 23 runWithKeyDown(function() { span.webkitRequestFullScreen(); }); | |
| 24 }; | |
| 25 | |
| 26 var span = document.querySelector("span"); | |
| 27 function spanEnteredFullScreen() | |
| 28 { | |
| 29 testExpected("document.webkitCurrentFullScreenElement", span); | |
| 30 callback = cancelledFullScreen; | |
| 31 document.webkitCancelFullScreen(); | |
| 32 }; | |
| 33 | |
| 34 function cancelledFullScreen() | |
| 35 { | |
| 36 testExpected("document.webkitCurrentFullScreenElement", body); | |
| 37 endTest(); | |
| 38 }; | |
| 39 | |
| 40 callback = bodyEnteredFullScreen; | |
| 41 runWithKeyDown(function() { body.webkitRequestFullScreen(); }); | |
| 42 } | |
| 43 </script> | |
|
falken
2014/08/06 04:18:30
nit: add </body>
| |
| OLD | NEW |