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: waitForExplicitFinish(); michael@0: michael@0: // establish initial state michael@0: is(gBrowser.tabs.length, 1, "we start with one tab"); michael@0: michael@0: // create a tab michael@0: let tab = gBrowser.loadOneTab("about:blank"); michael@0: ok(!tab.hidden, "tab starts out not hidden"); michael@0: is(gBrowser.tabs.length, 2, "we now have two tabs"); michael@0: michael@0: // make sure .hidden is read-only michael@0: tab.hidden = true; michael@0: ok(!tab.hidden, "can't set .hidden directly"); michael@0: michael@0: // hide the tab michael@0: gBrowser.hideTab(tab); michael@0: ok(tab.hidden, "tab is hidden"); michael@0: michael@0: // now pin it and make sure it gets unhidden michael@0: gBrowser.pinTab(tab); michael@0: ok(tab.pinned, "tab was pinned"); michael@0: ok(!tab.hidden, "tab was unhidden"); michael@0: michael@0: // try hiding it now that it's pinned; shouldn't be able to michael@0: gBrowser.hideTab(tab); michael@0: ok(!tab.hidden, "tab did not hide"); michael@0: michael@0: // clean up michael@0: gBrowser.removeTab(tab); michael@0: is(gBrowser.tabs.length, 1, "we finish with one tab"); michael@0: michael@0: finish(); michael@0: }