mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-04 16:15:25 +00:00
28 lines
816 B
JavaScript
28 lines
816 B
JavaScript
function test() {
|
|
waitForExplicitFinish();
|
|
|
|
var win = openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no");
|
|
|
|
win.addEventListener("load", function () {
|
|
win.removeEventListener("load", arguments.callee, false);
|
|
|
|
win.content.addEventListener("focus", function () {
|
|
win.content.removeEventListener("focus", arguments.callee, false);
|
|
|
|
function onTabClose() {
|
|
ok(false, "shouldn't have gotten the TabClose event for the last tab");
|
|
}
|
|
var tab = win.gBrowser.selectedTab;
|
|
tab.addEventListener("TabClose", onTabClose, false);
|
|
|
|
EventUtils.synthesizeKey("w", { accelKey: true }, win);
|
|
|
|
ok(win.closed, "accel+w closed the window immediately");
|
|
|
|
tab.removeEventListener("TabClose", onTabClose, false);
|
|
|
|
finish();
|
|
}, false);
|
|
}, false);
|
|
}
|