summaryrefslogtreecommitdiffstats
path: root/browser/components/sessionstore/test/browser_528776.js
diff options
context:
space:
mode:
Diffstat (limited to 'browser/components/sessionstore/test/browser_528776.js')
-rw-r--r--browser/components/sessionstore/test/browser_528776.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/browser/components/sessionstore/test/browser_528776.js b/browser/components/sessionstore/test/browser_528776.js
new file mode 100644
index 000000000..d799c9740
--- /dev/null
+++ b/browser/components/sessionstore/test/browser_528776.js
@@ -0,0 +1,21 @@
+function browserWindowsCount(expected) {
+ var count = 0;
+ var e = Services.wm.getEnumerator("navigator:browser");
+ while (e.hasMoreElements()) {
+ if (!e.getNext().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(function() {
+ browserWindowsCount(1);
+
+ let win = yield BrowserTestUtils.openNewBrowserWindow();
+ browserWindowsCount(2);
+ yield BrowserTestUtils.closeWindow(win);
+ browserWindowsCount(1);
+});