2009-04-05 01:10:24 -07:00
|
|
|
function test() {
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
Bug 178324, refactor focus by moving all focus handling into one place and simplifying it, add many tests, fixes many other bugs too numerous to mention in this small checkin comment, r=josh,smichaud,ere,dbaron,marco,neil,gavin,smaug,sr=smaug (CLOSED TREE)
2009-06-10 11:00:39 -07:00
|
|
|
// 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);
|
|
|
|
|
2009-04-05 01:10:24 -07:00
|
|
|
var win = openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no");
|
|
|
|
|
|
|
|
win.addEventListener("load", function () {
|
|
|
|
win.removeEventListener("load", arguments.callee, false);
|
|
|
|
|
Bug 178324, refactor focus by moving all focus handling into one place and simplifying it, add many tests, fixes many other bugs too numerous to mention in this small checkin comment, r=josh,smichaud,ere,dbaron,marco,neil,gavin,smaug,sr=smaug (CLOSED TREE)
2009-06-10 11:00:39 -07:00
|
|
|
win.content.addEventListener("focus", function () {
|
|
|
|
win.content.removeEventListener("focus", arguments.callee, false);
|
|
|
|
|
|
|
|
EventUtils.synthesizeKey("w", { accelKey: true }, win);
|
|
|
|
ok(win.closed, "accel+w closed the window immediately");
|
|
|
|
}, false);
|
|
|
|
|
2009-04-05 01:10:24 -07:00
|
|
|
win.gBrowser.selectedTab.addEventListener("TabClose", function () {
|
|
|
|
ok(false, "shouldn't have gotten the TabClose event for the last tab");
|
|
|
|
}, false);
|
|
|
|
|
|
|
|
}, false);
|
|
|
|
}
|