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: Services.prefs.setBoolPref("browser.tabs.animate", false); michael@0: registerCleanupFunction(function() { michael@0: Services.prefs.clearUserPref("browser.tabs.animate"); michael@0: }); michael@0: michael@0: // Open 2 other tabs, and pin the second one. Like that, the initial tab michael@0: // should get closed. michael@0: let testTab1 = gBrowser.addTab(); michael@0: let testTab2 = gBrowser.addTab(); michael@0: gBrowser.pinTab(testTab2); michael@0: michael@0: // Now execute "Close other Tabs" on the first manually opened tab (tab1). michael@0: // -> tab2 ist pinned, tab1 should remain open and the initial tab should michael@0: // get closed. michael@0: gBrowser.removeAllTabsBut(testTab1); michael@0: michael@0: is(gBrowser.tabs.length, 2, "there are two remaining tabs open"); michael@0: is(gBrowser.tabs[0], testTab2, "pinned tab2 stayed open"); michael@0: is(gBrowser.tabs[1], testTab1, "tab1 stayed open"); michael@0: michael@0: // Cleanup. Close only one tab because we need an opened tab at the end of michael@0: // the test. michael@0: gBrowser.removeTab(testTab2); michael@0: }