B2G/gecko/browser/components/tabview/test/browser_tabview_bug608184.js
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */
Any copyright is dedicated to the Public Domain.
Any copyright is dedicated to the Public Domain .
function test() {
  waitForExplicitFinish();
  let origTab = gBrowser.visibleTabs[0];
  let newTab = gBrowser.addTab();
  gBrowser.selectedTab = newTab;
  let relatedTab = gBrowser.addTab("about:blank", { ownerTab: newTab });
  TabView._initFrame(function() {
    let newTabGroupItemId = newTab._tabViewTabItem.parent.id;
    is(relatedTab.owner, newTab, "The related tab's owner is the right tab");
    TabView.moveTabTo(newTab, null);
    gBrowser.removeTab(relatedTab);
    is(gBrowser.visibleTabs.length, 1, "The number of visible tabs is 1");
    is(gBrowser.visibleTabs[0], origTab, 
      "The original tab is the only visible tab");
    isnot(newTab._tabViewTabItem.parent.id, newTabGroupItemId, 
      "The moved tab item has a new group id");
    gBrowser.removeTab(newTab);
    finish();
  });
}
function test ( ) { waitForExplicitFinish ( ) ; let origTab = gBrowser . visibleTabs [ 0 ] ; let newTab = gBrowser . addTab ( ) ; gBrowser . selectedTab = newTab ; let relatedTab = gBrowser . addTab ( "about:blank" , { ownerTab : newTab } ) ; TabView . _initFrame ( function ( ) { let newTabGroupItemId = newTab . _tabViewTabItem . parent . id ; is ( relatedTab . owner , newTab , "The related tab's owner is the right tab" ) ; TabView . moveTabTo ( newTab , null ) ; gBrowser . removeTab ( relatedTab ) ; is ( gBrowser . visibleTabs . length , 1 , "The number of visible tabs is 1" ) ; is ( gBrowser . visibleTabs [ 0 ] , origTab , "The original tab is the only visible tab" ) ; isnot ( newTab . _tabViewTabItem . parent . id , newTabGroupItemId , "The moved tab item has a new group id" ) ; gBrowser . removeTab ( newTab ) ; finish ( ) ; } ) ; }
Any copyright is dedicated to the Public Domain.
Any copyright is dedicated to the Public Domain .
// init the frame, move the owner tab to a new group and close the related // tab. // move current tab to a new group // close the related tab // clean up