michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: function test() { michael@0: // Add two new tabs after the original tab. Pin the first one. michael@0: let originalTab = gBrowser.selectedTab; michael@0: let newTab1 = gBrowser.addTab(); michael@0: let newTab2 = gBrowser.addTab(); michael@0: gBrowser.pinTab(newTab1); michael@0: michael@0: // Check that there is only one closable tab from originalTab to the end michael@0: is(gBrowser.getTabsToTheEndFrom(originalTab).length, 1, michael@0: "One unpinned tab to the right"); michael@0: michael@0: // Remove tabs to the end michael@0: gBrowser.removeTabsToTheEndFrom(originalTab); michael@0: is(gBrowser.tabs.length, 2, "Length is 2"); michael@0: is(gBrowser.tabs[1], originalTab, "Starting tab is not removed"); michael@0: is(gBrowser.tabs[0], newTab1, "Pinned tab is not removed"); michael@0: michael@0: // Remove pinned tab michael@0: gBrowser.removeTab(newTab1); michael@0: }