async function testBottomHost(toolbox, tab1, tab2) { // switch to another tab and test toolbox.raise()
gBrowser.selectedTab = tab2;
await new Promise(executeSoon);
is(
gBrowser.selectedTab,
tab2, "Correct tab is selected before calling raise"
);
await toolbox.raise();
is(
gBrowser.selectedTab,
tab1, "Correct tab was selected after calling raise"
);
}
async function testWindowHost(toolbox) {
await toolbox.switchHost(Toolbox.HostType.WINDOW);
info("Wait for the toolbox to be focused when switching to window host"); // We can't wait for the "focus" event on toolbox.win.parent as this document is created while calling switchHost.
await waitFor(() => { return Services.focus.activeWindow == toolbox.topWindow;
});
info("Focusing the browser window");
window.focus();
info("Wait for the browser window to be focused");
await onBrowserWindowFocused;
// Now raise toolbox.
await toolbox.raise();
is(
Services.focus.activeWindow,
toolbox.topWindow, "the toolbox window is immediately focused after raise resolution"
);
}
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
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 ist noch experimentell.