function info(msg) {
opener.info("[single] " + msg);
}
function windowResized() {
info(`Window resized to width: ${window.innerWidth}, height: ${window.innerHeight}.`);
}
async function begin() {
window.addEventListener('resize', windowResized);
info(`Starting window width: ${window.innerWidth}, height: ${window.innerHeight}.`);
let windowedWidth = window.innerWidth;
let windowedHeight = window.innerHeight;
info("Requesting fullscreen.");
let entryPromise = document.getElementById('fullscreen-div').requestFullscreen()
info("Fullscreen requested, waiting for promise to resolve.");
await entryPromise;
info("element.requestFullscreen() promise resolved.");
info(`Fullscreen window width: ${window.innerWidth}, height: ${window.innerHeight}.`);
isnot(document.fullscreenElement, null, "document.fullscreenElement should exist.");
ok(window.fullScreen, "window.fullScreen");
isnot(windowedWidth, window.innerWidth, "window width should be changed.");
isnot(windowedHeight, window.innerHeight, "window height should be changed.");
info("Requesting fullscreen exit.");
let exitPromise = document.exitFullscreen()
info("Fullscreen exit requested, waiting for promise to resolve.");
await exitPromise;
info("document.exitFullscreen() promise resolved.");
info(`Restored window width: ${window.innerWidth}, height: ${window.innerHeight}.`);
is(document.fullscreenElement, null, "document.fullscreenElement should be null.");
ok(!window.fullScreen, "window.fullScreen should be false.");
is(window.innerWidth, windowedWidth, "window width should be restored.");
is(window.innerHeight, windowedHeight, "window height should be restored.");
opener.nextTest();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.