summaryrefslogtreecommitdiffstats
path: root/dom/base/test/browser_pagehide_on_tab_close.js
blob: 4db890aa57198a9cfa7ee5a873d6d4a4bb937ec8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function test() {
  waitForExplicitFinish();

  var tab = BrowserTestUtils.addTab(gBrowser);
  gBrowser.selectedTab = tab;

  tab.linkedBrowser.addEventListener(
    "load",
    function () {
      tab.linkedBrowser.addEventListener("pagehide", function () {
        ok(true, "got page hide event");
        finish();
      });

      executeSoon(() => {
        gBrowser.removeTab(tab);
      });
    },
    { capture: true, once: true }
  );
}