mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Count open windows in browser_394759.js for bug 528776
This commit is contained in:
parent
7e0a012c40
commit
67105dfe67
@ -50,9 +50,23 @@ function waitForBrowserState(aState, aSetStateCallback) {
|
|||||||
ss.setBrowserState(JSON.stringify(aState));
|
ss.setBrowserState(JSON.stringify(aState));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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() {
|
function test() {
|
||||||
/** Test for Bug 394759 **/
|
/** Test for Bug 394759 **/
|
||||||
|
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||||
|
|
||||||
// test setup
|
// test setup
|
||||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].getService(Ci.nsIPrivateBrowsingService);
|
let pb = Cc["@mozilla.org/privatebrowsing;1"].getService(Ci.nsIPrivateBrowsingService);
|
||||||
@ -312,6 +326,7 @@ function test() {
|
|||||||
test_basic(function() {
|
test_basic(function() {
|
||||||
test_behavior(function() {
|
test_behavior(function() {
|
||||||
test_purge(function() {
|
test_purge(function() {
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
finish();
|
finish();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user