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