browser_bug484315.js
Go to the documentation of this file.
1 function test() {
2  var contentWin = window.open("about:blank", "", "width=100,height=100");
3  var enumerator = Cc["@mozilla.org/appshell/window-mediator;1"]
4  .getService(Ci.nsIWindowMediator)
5  .getEnumerator("navigator:browser");
6 
7  while (enumerator.hasMoreElements()) {
8  let win = enumerator.getNext();
9  if (win.content == contentWin) {
10  gPrefService.setBoolPref("browser.tabs.closeWindowWithLastTab", false);
11  win.gBrowser.removeCurrentTab();
12  ok(win.closed, "popup is closed");
13 
14  // clean up
15  if (!win.closed)
16  win.close();
17  if (gPrefService.prefHasUserValue("browser.tabs.closeWindowWithLastTab"))
18  gPrefService.clearUserPref("browser.tabs.closeWindowWithLastTab");
19 
20  return;
21  }
22  }
23 
24  throw "couldn't find the content window";
25 }
const Cc
let window
function test()
var gPrefService
Definition: overlay.js:34
const Ci