Bug 1052750 - try to fix intermittent timeouts in browser urlbar search test by waiting for focus on the newly opened window, rs=firebot

This commit is contained in:
Gijs Kruitbosch 2014-08-13 10:56:52 +01:00
Родитель 18a50dd690
Коммит c9a9e21bb2
1 изменённых файлов: 9 добавлений и 1 удалений

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

@ -65,7 +65,15 @@ add_task(function* test_navigate_full_domain() {
function get_test_function_for_localhost_with_hostname(hostName, isPrivate) {
return function* test_navigate_single_host() {
const pref = "browser.fixup.domainwhitelist.localhost";
let win = isPrivate ? yield promiseOpenAndLoadWindow({private: true}, true) : window;
let win;
if (isPrivate) {
win = yield promiseOpenAndLoadWindow({private: true}, true);
let deferredOpenFocus = Promise.defer();
waitForFocus(deferredOpenFocus.resolve, win);
yield deferredOpenFocus.promise;
} else {
win = window;
}
let browser = win.gBrowser;
let tab = browser.selectedTab = browser.addTab();