gecko-dev/dom/html/test/file_fullscreen-featurePolicy-inner.html
Gijs Kruitbosch ec4136b39b Bug 1504062 - fix timeouts in dom test_fullscreen_api.html, r=kats
Differential Revision: https://phabricator.services.mozilla.com/D10723

--HG--
extra : moz-landing-system : lando
2018-11-02 16:46:54 +00:00

29 lines
887 B
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body onload="doRequestFullscreen()">
<script>
function doRequestFullscreen() {
function handler(evt) {
document.removeEventListener("fullscreenchange", handler);
document.removeEventListener("fullscreenerror", handler);
if (evt.type == "fullscreenchange") {
document.addEventListener("fullscreenchange", () => parent.continueTest(evt.type), {once: true});
document.exitFullscreen();
} else {
parent.continueTest(evt.type);
}
}
parent.ok(document.fullscreenEnabled, "Fullscreen " +
`should be enabled in ${parent.testTargetName}`);
document.addEventListener("fullscreenchange", handler);
document.addEventListener("fullscreenerror", handler);
parent.opener.info("Requesting fullscreen");
document.documentElement.requestFullscreen();
}
</script>
</body>
</html>