Bug 1102015, adjust browser_bug427559.js test to not use the command dispatcher and reenable it, r=gijs

This commit is contained in:
Neil Deakin 2015-02-19 08:06:51 -05:00
parent bbc6a8a249
commit 38bb5178ee
2 changed files with 20 additions and 12 deletions

View File

@ -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]

View File

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