mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1121671, see if using the TabSwitchDone event will work, r=test-only=change
This commit is contained in:
parent
8c283f2c17
commit
0f8deeb60f
@ -23,11 +23,19 @@ function *promiseTabLoadEvent(tab, url)
|
||||
|
||||
// Load a new blank tab
|
||||
add_task(function *() {
|
||||
let tab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = tab;
|
||||
let tab;
|
||||
|
||||
let browser = gBrowser.getBrowserForTab(tab);
|
||||
yield new Promise(resolve => {
|
||||
gBrowser.addEventListener("TabSwitchDone", function onSwitch() {
|
||||
gBrowser.removeEventListener("TabSwitchDone", onSwitch);
|
||||
executeSoon(resolve);
|
||||
});
|
||||
tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
});
|
||||
|
||||
gURLBar.focus();
|
||||
|
||||
let browser = gBrowser.selectedBrowser;
|
||||
yield SimpleTest.promiseFocus(browser.contentWindowAsCPOW, true);
|
||||
|
||||
is(document.activeElement, browser, "Browser is focused when about:blank is loaded");
|
||||
|
Loading…
Reference in New Issue
Block a user