mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
additional output in browser_526613.js
This commit is contained in:
parent
cbdb1b3eb4
commit
8e9bf77329
@ -47,28 +47,22 @@ function test() {
|
||||
getService(Ci.nsIWindowMediator);
|
||||
waitForExplicitFinish();
|
||||
|
||||
function browserWindowsCount() {
|
||||
function browserWindowsCount(expected) {
|
||||
let count = 0;
|
||||
let e = wm.getEnumerator("navigator:browser");
|
||||
while (e.hasMoreElements()) {
|
||||
let win = e.getNext();
|
||||
if (!win.closed) {
|
||||
if (!e.getNext().closed)
|
||||
++count;
|
||||
if (win != window) {
|
||||
try {
|
||||
var tabs = win.gBrowser.mTabs.length;
|
||||
} catch (e) {
|
||||
info(e);
|
||||
}
|
||||
info("secondary window: " + [win.document.readyState, win.content.location, tabs]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
is(count, expected,
|
||||
"number of open browser windows according to nsIWindowMediator");
|
||||
let state = ss.getBrowserState();
|
||||
info(state);
|
||||
is(JSON.parse(state).windows.length, expected,
|
||||
"number of open browser windows according to getBrowserState");
|
||||
}
|
||||
|
||||
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||
browserWindowsCount(1);
|
||||
|
||||
// backup old state
|
||||
let oldState = ss.getBrowserState();
|
||||
@ -89,8 +83,8 @@ function test() {
|
||||
is(aTopic, "sessionstore-browser-state-restored",
|
||||
"The sessionstore-browser-state-restored notification was observed");
|
||||
|
||||
if (this.pass++ == 1) {
|
||||
is(browserWindowsCount(), 2, "Two windows should exist at this point");
|
||||
if (this.pass++ == 1) {
|
||||
browserWindowsCount(2);
|
||||
|
||||
// let the first window be focused (see above)
|
||||
function pollMostRecentWindow() {
|
||||
@ -105,7 +99,7 @@ function test() {
|
||||
pollMostRecentWindow();
|
||||
}
|
||||
else {
|
||||
is(browserWindowsCount(), 1, "Only one window should exist after cleanup");
|
||||
browserWindowsCount(1);
|
||||
ok(!window.closed, "Restoring the old state should have left this window open");
|
||||
os.removeObserver(this, "sessionstore-browser-state-restored");
|
||||
finish();
|
||||
|
Loading…
Reference in New Issue
Block a user