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: newWindowWithTabView(win => { michael@0: is(win.gBrowser.tabs.length, 1, "There is only one tab"); michael@0: michael@0: let tab = win.gBrowser.tabs[0]; michael@0: let tabItem = tab._tabViewTabItem; michael@0: ok(tabItem.parent, "The tab item belongs to a group"); michael@0: let groupId = tabItem.parent.id; michael@0: michael@0: tab._tabViewTabItem.close(); michael@0: michael@0: whenTabViewIsHidden(function() { michael@0: // a new tab with group should be opened michael@0: is(win.gBrowser.tabs.length, 1, "There is still one tab"); michael@0: isnot(win.gBrowser.selectedTab, tab, "The tab is different"); michael@0: michael@0: tab = win.gBrowser.tabs[0]; michael@0: tabItem = tab._tabViewTabItem; michael@0: ok(tabItem.parent, "This new tab item belongs to a group"); michael@0: michael@0: is(tabItem.parent.id, groupId, "The group is different"); michael@0: michael@0: promiseWindowClosed(win).then(finish); michael@0: }, win); michael@0: }); michael@0: }