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: let win, contentWindow, originalTab, newTab1, newTab2; michael@0: michael@0: let partOne = function () { michael@0: let groupItem = contentWindow.GroupItems.groupItems[0]; michael@0: let tabItems = groupItem.getChildren(); michael@0: is(tabItems.length, 2, "There are two tab items in that group item"); michael@0: is(tabItems[0].tab, originalTab, "The first tab item is linked to the first tab"); michael@0: is(tabItems[1].tab, newTab2, "The second tab item is linked to the second tab"); michael@0: michael@0: hideTabView(partTwo, win); michael@0: }; michael@0: michael@0: let partTwo = function () { michael@0: win.gBrowser.unpinTab(newTab1); michael@0: showTabView(partThree, win); michael@0: }; michael@0: michael@0: let partThree = function () { michael@0: let tabItems = contentWindow.GroupItems.groupItems[0].getChildren(); michael@0: is(tabItems.length, 3, "There are three tab items in that group item"); michael@0: is(tabItems[0].tab, win.gBrowser.tabs[0], "The first tab item is linked to the first tab"); michael@0: is(tabItems[1].tab, win.gBrowser.tabs[1], "The second tab item is linked to the second tab"); michael@0: is(tabItems[2].tab, win.gBrowser.tabs[2], "The third tab item is linked to the third tab"); michael@0: michael@0: finish(); michael@0: }; michael@0: michael@0: let onLoad = function (tvwin) { michael@0: win = tvwin; michael@0: registerCleanupFunction(function () win.close()); michael@0: michael@0: for (let i = 0; i < 2; i++) michael@0: win.gBrowser.loadOneTab("about:blank", {inBackground: true}); michael@0: michael@0: [originalTab, newTab1, newTab2] = win.gBrowser.tabs; michael@0: win.gBrowser.pinTab(newTab1); michael@0: }; michael@0: michael@0: let onShow = function () { michael@0: contentWindow = win.TabView.getContentWindow(); michael@0: is(contentWindow.GroupItems.groupItems.length, 1, "There is only one group item"); michael@0: michael@0: partOne(); michael@0: }; michael@0: michael@0: waitForExplicitFinish(); michael@0: newWindowWithTabView(onShow, onLoad); michael@0: }