browser/components/sessionstore/test/browser_528776.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 function browserWindowsCount(expected) {
     2   var count = 0;
     3   var e = Services.wm.getEnumerator("navigator:browser");
     4   while (e.hasMoreElements()) {
     5     if (!e.getNext().closed)
     6       ++count;
     7   }
     8   is(count, expected,
     9      "number of open browser windows according to nsIWindowMediator");
    10   is(JSON.parse(ss.getBrowserState()).windows.length, expected,
    11      "number of open browser windows according to getBrowserState");
    12 }
    14 function test() {
    15   waitForExplicitFinish();
    17   browserWindowsCount(1);
    19   var win = openDialog(location, "", "chrome,all,dialog=no");
    20   win.addEventListener("load", function () {
    21     win.removeEventListener("load", arguments.callee, false);
    22     browserWindowsCount(2);
    23     win.close();
    24     browserWindowsCount(1);
    25     finish();
    26   }, false);
    27 }

mercurial