1
0
Fork 0
firefox/browser/components/sessionstore/test/browser_528776.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

27 lines
639 B
JavaScript

function browserWindowsCount(expected) {
var count = 0;
for (let win of Services.wm.getEnumerator("navigator:browser")) {
if (!win.closed) {
++count;
}
}
is(
count,
expected,
"number of open browser windows according to nsIWindowMediator"
);
is(
JSON.parse(ss.getBrowserState()).windows.length,
expected,
"number of open browser windows according to getBrowserState"
);
}
add_task(async function () {
browserWindowsCount(1);
let win = await BrowserTestUtils.openNewBrowserWindow();
browserWindowsCount(2);
await BrowserTestUtils.closeWindow(win);
browserWindowsCount(1);
});