mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Count open windows in browser_514751.js for bug 528776
This commit is contained in:
parent
1d7590ae69
commit
00ff1dc6e1
@ -34,8 +34,21 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
function browserWindowsCount() {
|
||||
let count = 0;
|
||||
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Ci.nsIWindowMediator)
|
||||
.getEnumerator("navigator:browser");
|
||||
while (e.hasMoreElements()) {
|
||||
if (!e.getNext().closed)
|
||||
++count;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
function test() {
|
||||
/** Test for Bug 514751 (Wallpaper) **/
|
||||
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||
|
||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].
|
||||
getService(Ci.nsISessionStore);
|
||||
@ -81,6 +94,7 @@ function test() {
|
||||
|
||||
case "domwindowclosed":
|
||||
ww.unregisterNotification(this);
|
||||
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||
finish();
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user