tor-browser

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

browser_bug585830.js (890B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 function test() {
      6  let tab1 = gBrowser.selectedTab;
      7  let tab2 = BrowserTestUtils.addTab(gBrowser, "about:blank", {
      8    skipAnimation: true,
      9  });
     10  BrowserTestUtils.addTab(gBrowser);
     11  gBrowser.selectedTab = tab2;
     12 
     13  gBrowser.removeCurrentTab({ animate: true });
     14  gBrowser.tabContainer.advanceSelectedTab(-1, true);
     15  is(gBrowser.selectedTab, tab1, "First tab should be selected");
     16  gBrowser.removeTab(tab2);
     17 
     18  // test for "null has no properties" fix. See Bug 585830 Comment 13
     19  gBrowser.removeCurrentTab({ animate: true });
     20  try {
     21    gBrowser.tabContainer.advanceSelectedTab(-1, false);
     22  } catch (err) {
     23    ok(false, "Shouldn't throw");
     24  }
     25 
     26  gBrowser.removeTab(tab1);
     27 }