blob: 53a213b40b09bdd2f1bd48d6f55d61ad18113dec [file] [log] [blame]
<!DOCTYPE html>
<script src="full-screen-test.js"></script>
var one;
var two;
function runTest() {
one = document.getElementById('one');
two = document.getElementById('two');
var callback;
var fullscreenChanged = function(event) {
if (callback)
waitForEvent(document, 'webkitfullscreenchange', fullscreenChanged);
var oneEnteredFullscreen = function() {
testExpected("", "one");
callback = twoEnteredFullscreen;
if (window.testRunner)
runWithKeyDown(function() { two.webkitRequestFullscreen(); });
var twoEnteredFullscreen = function() {
testExpected("", "two");
callback = twoExitedFullscreen;
if (window.testRunner)
var twoExitedFullscreen = function() {
testExpected("", "one");
callback = oneEnteredFullscreen;
if (window.testRunner)
runWithKeyDown(function() { one.webkitRequestFullscreen(); });
<body onload="runTest()">
<p>Test for <a href="">W3C Fullscreen element stack</a>.</p>
<p>To test manually, click the "Go full screen" button - the page should enter full screen mode.</p>
<button onclick="one.webkitRequestFullscreen()">Go full screen (one)</button>
<div id=one>
<button onclick="two.webkitRequestFullscreen()">Go full screen (two)</button>
<div id=two>
<button onclick="document.webkitExitFullscreen()">Exit full screen (two)</button>