Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | function test() { |
michael@0 | 6 | Services.prefs.setBoolPref("browser.tabs.animate", false); |
michael@0 | 7 | registerCleanupFunction(function() { |
michael@0 | 8 | Services.prefs.clearUserPref("browser.tabs.animate"); |
michael@0 | 9 | }); |
michael@0 | 10 | |
michael@0 | 11 | // Open 2 other tabs, and pin the second one. Like that, the initial tab |
michael@0 | 12 | // should get closed. |
michael@0 | 13 | let testTab1 = gBrowser.addTab(); |
michael@0 | 14 | let testTab2 = gBrowser.addTab(); |
michael@0 | 15 | gBrowser.pinTab(testTab2); |
michael@0 | 16 | |
michael@0 | 17 | // Now execute "Close other Tabs" on the first manually opened tab (tab1). |
michael@0 | 18 | // -> tab2 ist pinned, tab1 should remain open and the initial tab should |
michael@0 | 19 | // get closed. |
michael@0 | 20 | gBrowser.removeAllTabsBut(testTab1); |
michael@0 | 21 | |
michael@0 | 22 | is(gBrowser.tabs.length, 2, "there are two remaining tabs open"); |
michael@0 | 23 | is(gBrowser.tabs[0], testTab2, "pinned tab2 stayed open"); |
michael@0 | 24 | is(gBrowser.tabs[1], testTab1, "tab1 stayed open"); |
michael@0 | 25 | |
michael@0 | 26 | // Cleanup. Close only one tab because we need an opened tab at the end of |
michael@0 | 27 | // the test. |
michael@0 | 28 | gBrowser.removeTab(testTab2); |
michael@0 | 29 | } |