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
Родитель a3885e5d47
Коммит 23b546c1a4
1 изменённых файлов: 11 добавлений и 3 удалений

Просмотреть файл

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