зеркало из https://github.com/mozilla/gecko-dev.git
Backing out 655f2ee419a7 to fix orange
This commit is contained in:
Родитель
502b37df7e
Коммит
b583360e01
|
@ -52,6 +52,8 @@ function test() {
|
||||||
|
|
||||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].
|
let ss = Cc["@mozilla.org/browser/sessionstore;1"].
|
||||||
getService(Ci.nsISessionStore);
|
getService(Ci.nsISessionStore);
|
||||||
|
let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
|
||||||
|
getService(Ci.nsIWindowWatcher);
|
||||||
|
|
||||||
waitForExplicitFinish();
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
@ -66,8 +68,14 @@ function test() {
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
|
|
||||||
var theWin = openDialog(location, "", "chrome,all,dialog=no");
|
let windowObserver = {
|
||||||
|
observe: function(aSubject, aTopic, aData) {
|
||||||
|
let theWin = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||||
|
|
||||||
|
switch(aTopic) {
|
||||||
|
case "domwindowopened":
|
||||||
theWin.addEventListener("load", function () {
|
theWin.addEventListener("load", function () {
|
||||||
|
theWin.removeEventListener("load", arguments.callee, false);
|
||||||
executeSoon(function() {
|
executeSoon(function() {
|
||||||
var gotError = false;
|
var gotError = false;
|
||||||
try {
|
try {
|
||||||
|
@ -77,10 +85,27 @@ function test() {
|
||||||
gotError = true;
|
gotError = true;
|
||||||
}
|
}
|
||||||
ok(!gotError, "Didn't get a malformed URI error.");
|
ok(!gotError, "Didn't get a malformed URI error.");
|
||||||
|
executeSoon(function() {
|
||||||
theWin.close();
|
theWin.close();
|
||||||
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
});
|
||||||
finish();
|
|
||||||
});
|
});
|
||||||
}, false);
|
}, false);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "domwindowclosed":
|
||||||
|
ww.unregisterNotification(this);
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
|
finish();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ww.registerNotification(windowObserver);
|
||||||
|
ww.openWindow(null,
|
||||||
|
location,
|
||||||
|
"_blank",
|
||||||
|
"chrome,all,dialog=no",
|
||||||
|
null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче