зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1121671, see if using the TabSwitchDone event will work, r=test-only=change
This commit is contained in:
Родитель
a3885e5d47
Коммит
23b546c1a4
|
@ -23,11 +23,19 @@ function *promiseTabLoadEvent(tab, url)
|
||||||
|
|
||||||
// Load a new blank tab
|
// Load a new blank tab
|
||||||
add_task(function *() {
|
add_task(function *() {
|
||||||
let tab = gBrowser.addTab();
|
let tab;
|
||||||
gBrowser.selectedTab = 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);
|
yield SimpleTest.promiseFocus(browser.contentWindowAsCPOW, true);
|
||||||
|
|
||||||
is(document.activeElement, browser, "Browser is focused when about:blank is loaded");
|
is(document.activeElement, browser, "Browser is focused when about:blank is loaded");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче