зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1638263 - Full screen window after getting focus in test_bug665540. r=karlt
Differential Revision: https://phabricator.services.mozilla.com/D75662
This commit is contained in:
Родитель
96a75d8f03
Коммит
583e647fb1
|
@ -2,13 +2,7 @@
|
|||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
|
||||
<window title="Test Select Dropdown Positioning in Fullscreen Window"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
sizemode="fullscreen">
|
||||
|
||||
<script>
|
||||
window.arguments[0].SimpleTest.waitForFocus(window.arguments[0].childFocused, window);
|
||||
</script>
|
||||
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<select id="select" style="-moz-appearance:none">
|
||||
<option id="optiona">a</option>
|
||||
|
|
|
@ -36,29 +36,23 @@ let childHasFocused = false;
|
|||
|
||||
function openFullscreenWindow() {
|
||||
win = window.docShell.rootTreeItem.domWindow
|
||||
.openDialog("bug665540_window.xhtml", "_blank", "resizable=yes,chrome", window);
|
||||
info("win.windowState = " + win.windowState);
|
||||
info("win.fullScreen = " + win.fullScreen);
|
||||
.openDialog("bug665540_window.xhtml", "_blank", "resizable=yes,chrome");
|
||||
|
||||
// size mode and full screen may change asynchronously after child gets focused.
|
||||
if (win.windowState == win.STATE_FULLSCREEN) {
|
||||
win.addEventListener("sizemodechange", () => {
|
||||
info("sizemodechange. windowState = " + win.windowState + " fullScreen = " + win.fullScreen);
|
||||
sizemodeChanged = true;
|
||||
} else {
|
||||
win.addEventListener("sizemodechange", () => {
|
||||
info("sizemodechange. windowState = " + win.windowState + " fullScreen = " + win.fullScreen);
|
||||
sizemodeChanged = true;
|
||||
tryStart();
|
||||
}, { once: true });
|
||||
}
|
||||
if (win.fullScreen) {
|
||||
tryStart();
|
||||
}, { once: true });
|
||||
|
||||
win.addEventListener("fullscreen", () => {
|
||||
info("fullscreen event. windowState = " + win.windowState + " fullScreen = " + win.fullScreen);
|
||||
fullscreenChanged = true;
|
||||
} else {
|
||||
win.addEventListener("fullscreen", () => {
|
||||
info("fullscreen event. windowState = " + win.windowState + " fullScreen = " + win.fullScreen);
|
||||
fullscreenChanged = true;
|
||||
tryStart();
|
||||
}, { once: true });
|
||||
}
|
||||
tryStart();
|
||||
}, { once: true });
|
||||
|
||||
SimpleTest.waitForFocus(() => {
|
||||
win.fullScreen = true;
|
||||
}, win);
|
||||
|
||||
// Close our window if the test times out so that it doesn't interfere
|
||||
// with later tests.
|
||||
|
@ -69,17 +63,15 @@ function openFullscreenWindow() {
|
|||
}, 20000);
|
||||
}
|
||||
|
||||
function childFocused() {
|
||||
info("child focused. windowState = " + win.windowState + " fullScreen = " + win.fullScreen);
|
||||
childHasFocused = true;
|
||||
tryStart();
|
||||
}
|
||||
|
||||
function tryStart() {
|
||||
if (!sizemodeChanged || !fullscreenChanged || !childHasFocused) {
|
||||
// wait until the window goes full screen and its size mode actually changes.
|
||||
if (!sizemodeChanged || !fullscreenChanged) {
|
||||
return;
|
||||
}
|
||||
SimpleTest.waitForFocus(start, win);
|
||||
}
|
||||
|
||||
function start() {
|
||||
// The select doesn't open if the mouse click is fired too soon
|
||||
// (on X11 at least).
|
||||
setTimeout(openSelect, 1000);
|
||||
|
|
Загрузка…
Ссылка в новой задаче