Chromium Code Reviews| Index: LayoutTests/fullscreen/full-screen-cancel-nested.html |
| diff --git a/LayoutTests/fullscreen/full-screen-cancel-nested.html b/LayoutTests/fullscreen/full-screen-cancel-nested.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cc62eb5986190f7b817a242478c04b6a39f2ee92 |
| --- /dev/null |
| +++ b/LayoutTests/fullscreen/full-screen-cancel-nested.html |
| @@ -0,0 +1,43 @@ |
| +<body> |
|
falken
2014/08/06 04:18:30
nit: add <!DOCTYPE html>
|
| +<script src="full-screen-test.js"></script> |
|
falken
2014/08/06 04:18:30
nit: please add a brief description of what the te
|
| +<span></span> |
| +<script> |
| + // Bail out early if the full screen API is not enabled or is missing: |
| + if (Element.prototype.webkitRequestFullScreen == undefined) { |
| + logResult(false, "Element.prototype.webkitRequestFullScreen == undefined"); |
| + endTest(); |
| + } else { |
| + var callback; |
| + function fullscreenChanged(event) |
| + { |
| + if (callback) |
| + callback(event) |
| + }; |
| + waitForEvent(document, "webkitfullscreenchange", fullscreenChanged); |
| + |
| + var body = document.body; |
| + function bodyEnteredFullScreen() |
| + { |
| + testExpected("document.webkitCurrentFullScreenElement", body); |
| + callback = spanEnteredFullScreen; |
| + runWithKeyDown(function() { span.webkitRequestFullScreen(); }); |
| + }; |
| + |
| + var span = document.querySelector("span"); |
| + function spanEnteredFullScreen() |
| + { |
| + testExpected("document.webkitCurrentFullScreenElement", span); |
| + callback = cancelledFullScreen; |
| + document.webkitCancelFullScreen(); |
| + }; |
| + |
| + function cancelledFullScreen() |
| + { |
| + testExpected("document.webkitCurrentFullScreenElement", body); |
| + endTest(); |
| + }; |
| + |
| + callback = bodyEnteredFullScreen; |
| + runWithKeyDown(function() { body.webkitRequestFullScreen(); }); |
| + } |
| +</script> |
|
falken
2014/08/06 04:18:30
nit: add </body>
|