diff --git a/browser/base/content/test/general/browser.ini b/browser/base/content/test/general/browser.ini index 23d3472dfdd..5a34e800996 100644 --- a/browser/base/content/test/general/browser.ini +++ b/browser/base/content/test/general/browser.ini @@ -165,7 +165,6 @@ skip-if = true # bug 428712 [browser_bug424101.js] skip-if = e10s # Bug 1093155 - tries to use context menu from browser-chrome and gets in a mess when in e10s mode [browser_bug427559.js] -skip-if = e10s # Bug 1102015 - "content window is focused - Got [object ChromeWindow], expected [object CPOW [object Window]]" [browser_bug431826.js] [browser_bug432599.js] [browser_bug435035.js] diff --git a/browser/base/content/test/general/browser_bug427559.js b/browser/base/content/test/general/browser_bug427559.js index 50993f9b981..718e9505fb8 100644 --- a/browser/base/content/test/general/browser_bug427559.js +++ b/browser/base/content/test/general/browser_bug427559.js @@ -15,25 +15,34 @@ function test() { waitForExplicitFinish(); gBrowser.selectedTab = gBrowser.addTab(); + var browser = gBrowser.selectedBrowser; - gBrowser.selectedBrowser.addEventListener("load", function () { - gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true); - setTimeout(function () { + browser.addEventListener("load", function () { + browser.removeEventListener("load", arguments.callee, true); + executeSoon(function () { var testPageWin = content; + is(browser.contentDocumentAsCPOW.activeElement.localName, "button", "button is focused"); + + addEventListener("focus", function focusedWindow(event) { + if (!String(event.target.location).startsWith("data:")) + return; + + removeEventListener("focus", focusedWindow, true); + + // Make sure focus is given to the window because the element is now gone + is(browser.contentDocumentAsCPOW.activeElement.localName, "body", "body is focused"); + + gBrowser.removeCurrentTab(); + finish(); + }, true); + // The test page loaded, so open an empty tab, select it, then restore // the test tab. This causes the test page's focused element to be removed // from its document. gBrowser.selectedTab = gBrowser.addTab(); gBrowser.removeCurrentTab(); - - // Make sure focus is given to the window because the element is now gone - is(document.commandDispatcher.focusedWindow, testPageWin, - "content window is focused"); - - gBrowser.removeCurrentTab(); - finish(); - }, 0); + }); }, true); content.location = testPage;