diff --git a/browser/base/content/test/browser_bug481560.js b/browser/base/content/test/browser_bug481560.js index 6ad697ad95df..bca53de05299 100644 --- a/browser/base/content/test/browser_bug481560.js +++ b/browser/base/content/test/browser_bug481560.js @@ -1,15 +1,6 @@ function test() { waitForExplicitFinish(); - // focus the url field so that it will can ensure the focus is there when - // the window is refocused after the dialog closes - gURLBar.focus(); - - window.addEventListener("focus", function () { - window.removeEventListener("focus", arguments.callee, false); - finish(); - }, false); - var win = openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no"); win.addEventListener("load", function () { @@ -18,13 +9,15 @@ function test() { win.content.addEventListener("focus", function () { win.content.removeEventListener("focus", arguments.callee, false); + win.gBrowser.selectedTab.addEventListener("TabClose", function () { + ok(false, "shouldn't have gotten the TabClose event for the last tab"); + }, false); + EventUtils.synthesizeKey("w", { accelKey: true }, win); + ok(win.closed, "accel+w closed the window immediately"); - }, false); - win.gBrowser.selectedTab.addEventListener("TabClose", function () { - ok(false, "shouldn't have gotten the TabClose event for the last tab"); + finish(); }, false); - }, false); }