tor-browser

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

browser_bug577121.js (1038B)


      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  // Disable tab animations
      7  gReduceMotionOverride = true;
      8 
      9  // Open 2 other tabs, and pin the second one. Like that, the initial tab
     10  // should get closed.
     11  let testTab1 = BrowserTestUtils.addTab(gBrowser);
     12  let testTab2 = BrowserTestUtils.addTab(gBrowser);
     13  gBrowser.pinTab(testTab2);
     14 
     15  // Now execute "Close other Tabs" on the first manually opened tab (tab1).
     16  // -> tab2 ist pinned, tab1 should remain open and the initial tab should
     17  // get closed.
     18  gBrowser.removeAllTabsBut(testTab1);
     19 
     20  is(gBrowser.tabs.length, 2, "there are two remaining tabs open");
     21  is(gBrowser.tabs[0], testTab2, "pinned tab2 stayed open");
     22  is(gBrowser.tabs[1], testTab1, "tab1 stayed open");
     23 
     24  // Cleanup. Close only one tab because we need an opened tab at the end of
     25  // the test.
     26  gBrowser.removeTab(testTab2);
     27 }