browser/base/content/test/general/browser_bug484315.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 function test() {
     2   var contentWin = window.open("about:blank", "", "width=100,height=100");
     3   var enumerator = Services.wm.getEnumerator("navigator:browser");
     5   while (enumerator.hasMoreElements()) {
     6     let win = enumerator.getNext();
     7     if (win.content == contentWin) {
     8       gPrefService.setBoolPref("browser.tabs.closeWindowWithLastTab", false);
     9       win.gBrowser.removeCurrentTab();
    10       ok(win.closed, "popup is closed");
    12       // clean up
    13       if (!win.closed)
    14         win.close();
    15       if (gPrefService.prefHasUserValue("browser.tabs.closeWindowWithLastTab"))
    16         gPrefService.clearUserPref("browser.tabs.closeWindowWithLastTab");
    18       return;
    19     }
    20   }
    22   throw "couldn't find the content window";
    23 }

mercurial