tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_bug481560.js (514B)


      1 add_task(async function testTabCloseShortcut() {
      2  let win = await BrowserTestUtils.openNewBrowserWindow();
      3  await SimpleTest.promiseFocus(win);
      4 
      5  function onTabClose() {
      6    ok(false, "shouldn't have gotten the TabClose event for the last tab");
      7  }
      8  var tab = win.gBrowser.selectedTab;
      9  tab.addEventListener("TabClose", onTabClose);
     10 
     11  EventUtils.synthesizeKey("w", { accelKey: true }, win);
     12 
     13  ok(win.closed, "accel+w closed the window immediately");
     14 
     15  tab.removeEventListener("TabClose", onTabClose);
     16 });