Prevent browser_526613.js from closing the main browser window

--HG--
extra : rebase_source : 0378fa9b9ff451e84068fcf1f8881cf356f003d7
This commit is contained in:
Dão Gottwald 2009-11-12 18:25:50 +01:00
Родитель 816900d7a4
Коммит 19d525d586
1 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -82,11 +82,16 @@ function test() {
if (this.pass++ == 1) {
is(browserWindowsCount(), 2, "Two windows should exist at this point");
// executeSoon is needed here in order to let the first window be focused
// (see above)
executeSoon(function() {
// let the first window be focused (see above)
var fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
if (window == fm.activeWindow) {
ss.setBrowserState(oldState);
});
} else {
window.addEventListener("activate", function () {
window.removeEventListener("activate", arguments.callee, false);
ss.setBrowserState(oldState);
}, false);
}
}
else {
is(browserWindowsCount(), 1, "Only one window should exist after cleanup");