Bug 1121671, see if using the TabSwitchDone event will work, r=test-only=change

This commit is contained in:
Neil Deakin 2015-03-31 10:00:00 -04:00
parent 8c283f2c17
commit 0f8deeb60f

View File

@ -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");