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.
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/. */
5 function test() {
6 Services.prefs.setBoolPref("browser.tabs.animate", false);
7 registerCleanupFunction(function() {
8 Services.prefs.clearUserPref("browser.tabs.animate");
9 });
11 // Open 2 other tabs, and pin the second one. Like that, the initial tab
12 // should get closed.
13 let testTab1 = gBrowser.addTab();
14 let testTab2 = gBrowser.addTab();
15 gBrowser.pinTab(testTab2);
17 // Now execute "Close other Tabs" on the first manually opened tab (tab1).
18 // -> tab2 ist pinned, tab1 should remain open and the initial tab should
19 // get closed.
20 gBrowser.removeAllTabsBut(testTab1);
22 is(gBrowser.tabs.length, 2, "there are two remaining tabs open");
23 is(gBrowser.tabs[0], testTab2, "pinned tab2 stayed open");
24 is(gBrowser.tabs[1], testTab1, "tab1 stayed open");
26 // Cleanup. Close only one tab because we need an opened tab at the end of
27 // the test.
28 gBrowser.removeTab(testTab2);
29 }