B2G/gecko/browser/base/content/test/browser_bug597218.js
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
This Source Code Form is subject to the terms of the Mozilla Public
License, v.
This Source Code Form is subject to the terms of the Mozilla Public License v .
function test() {
  waitForExplicitFinish();
  is(gBrowser.tabs.length, 1, "we start with one tab");
  let tab = gBrowser.loadOneTab("about:blank");
  ok(!tab.hidden, "tab starts out not hidden");
  is(gBrowser.tabs.length, 2, "we now have two tabs");
  tab.hidden = true; 
  ok(!tab.hidden, "can't set .hidden directly");
  gBrowser.hideTab(tab);
  ok(tab.hidden, "tab is hidden");
  gBrowser.pinTab(tab);
  ok(tab.pinned, "tab was pinned");
  ok(!tab.hidden, "tab was unhidden");
  gBrowser.hideTab(tab);
  ok(!tab.hidden, "tab did not hide");
  gBrowser.removeTab(tab);
  is(gBrowser.tabs.length, 1, "we finish with one tab");
  finish();
}
function test ( ) { waitForExplicitFinish ( ) ; is ( gBrowser . tabs . length , 1 , "we start with one tab" ) ; let tab = gBrowser . loadOneTab ( "about:blank" ) ; ok ( ! tab . hidden , "tab starts out not hidden" ) ; is ( gBrowser . tabs . length , 2 , "we now have two tabs" ) ; tab . hidden = true ; ok ( ! tab . hidden , "can't set .hidden directly" ) ; gBrowser . hideTab ( tab ) ; ok ( tab . hidden , "tab is hidden" ) ; gBrowser . pinTab ( tab ) ; ok ( tab . pinned , "tab was pinned" ) ; ok ( ! tab . hidden , "tab was unhidden" ) ; gBrowser . hideTab ( tab ) ; ok ( ! tab . hidden , "tab did not hide" ) ; gBrowser . removeTab ( tab ) ; is ( gBrowser . tabs . length , 1 , "we finish with one tab" ) ; finish ( ) ; }
This Source Code Form is subject to the terms of the Mozilla Public
 License, v. 2.0.
This Source Code Form is subject to the terms of the Mozilla Public License v . 2 . 0 .
// establish initial state // create a tab // make sure .hidden is read-only // hide the tab // now pin it and make sure it gets unhidden // try hiding it now that it's pinned; shouldn't be able to // clean up