Commit 7fdf08e2 authored by Geoff Brown's avatar Geoff Brown
Browse files

Bug 1453895 - Avoid reftest startup hang waiting for focus; r=jmaher

Intermittently, at least on Windows, reftest.jsm finds that the reftest.xul
window is not focused on startup; focus seems to be on the dummy about:blank
window. This patch tries to detect that condition and correct it by bringing
reftest.xul (g.containingWindow) into focus before specifically focusing
the browser element (g.browser).
parent 87914795
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -305,6 +305,10 @@ function InitAndStartRefTests()

    // Focus the content browser.
    if (g.focusFilterMode != FOCUS_FILTER_NON_NEEDS_FOCUS_TESTS) {
        var fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
        if (fm.activeWindow != g.containingWindow) {
            Focus();
        }
        g.browser.addEventListener("focus", ReadTests, true);
        g.browser.focus();
    } else {