browser/components/tabview/test/browser_tabview_bug608184.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/components/tabview/test/browser_tabview_bug608184.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,36 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +function test() {
     1.8 +  waitForExplicitFinish();
     1.9 +
    1.10 +  let origTab = gBrowser.visibleTabs[0];
    1.11 +  let newTab = gBrowser.addTab();
    1.12 +  gBrowser.selectedTab = newTab;
    1.13 +  let relatedTab = gBrowser.addTab("about:blank", { ownerTab: newTab });
    1.14 +
    1.15 +  // init the frame, move the owner tab to a new group and close the related
    1.16 +  // tab.
    1.17 +  TabView._initFrame(function() {
    1.18 +    let newTabGroupItemId = newTab._tabViewTabItem.parent.id;
    1.19 +
    1.20 +    is(relatedTab.owner, newTab, "The related tab's owner is the right tab");
    1.21 +
    1.22 +    // move current tab to a new group
    1.23 +    TabView.moveTabTo(newTab, null);
    1.24 +
    1.25 +    // close the related tab
    1.26 +    gBrowser.removeTab(relatedTab);
    1.27 +
    1.28 +    is(gBrowser.visibleTabs.length, 1, "The number of visible tabs is 1");
    1.29 +    is(gBrowser.visibleTabs[0], origTab, 
    1.30 +      "The original tab is the only visible tab");
    1.31 +    isnot(newTab._tabViewTabItem.parent.id, newTabGroupItemId, 
    1.32 +      "The moved tab item has a new group id");
    1.33 +
    1.34 +    // clean up
    1.35 +    gBrowser.removeTab(newTab);
    1.36 +
    1.37 +    finish();
    1.38 +  });
    1.39 +}

mercurial