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 waitForExplicitFinish();
8 // establish initial state
9 is(gBrowser.tabs.length, 1, "we start with one tab");
11 // create a tab
12 let tab = gBrowser.loadOneTab("about:blank");
13 ok(!tab.hidden, "tab starts out not hidden");
14 is(gBrowser.tabs.length, 2, "we now have two tabs");
16 // make sure .hidden is read-only
17 tab.hidden = true;
18 ok(!tab.hidden, "can't set .hidden directly");
20 // hide the tab
21 gBrowser.hideTab(tab);
22 ok(tab.hidden, "tab is hidden");
24 // now pin it and make sure it gets unhidden
25 gBrowser.pinTab(tab);
26 ok(tab.pinned, "tab was pinned");
27 ok(!tab.hidden, "tab was unhidden");
29 // try hiding it now that it's pinned; shouldn't be able to
30 gBrowser.hideTab(tab);
31 ok(!tab.hidden, "tab did not hide");
33 // clean up
34 gBrowser.removeTab(tab);
35 is(gBrowser.tabs.length, 1, "we finish with one tab");
37 finish();
38 }