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 pinnedTab = gBrowser.addTab(); michael@0: gBrowser.pinTab(pinnedTab); michael@0: michael@0: registerCleanupFunction(function() { michael@0: gBrowser.unpinTab(pinnedTab); michael@0: michael@0: // Don't remove the initial tab. michael@0: gBrowser.moveTabTo(gBrowser.tabs[1], 0); michael@0: michael@0: while (gBrowser.tabs[1]) michael@0: gBrowser.removeTab(gBrowser.tabs[1]); michael@0: hideTabView(); michael@0: }); michael@0: michael@0: showTabView(function() { michael@0: let cw = TabView.getContentWindow(); michael@0: let groupItemOne = cw.GroupItems.groupItems[0]; michael@0: let groupItemTwo = createGroupItemWithBlankTabs(window, 250, 250, 40, 1); michael@0: michael@0: is(cw.GroupItems.groupItems.length, 2, "Two group items"); michael@0: michael@0: hideTabView(function() { michael@0: gBrowser.selectedTab = pinnedTab; michael@0: is(cw.GroupItems.getActiveGroupItem(), groupItemTwo, "Group two is active"); michael@0: is(gBrowser.selectedTab, pinnedTab, "Selected tab is the pinned tab"); michael@0: michael@0: goToNextGroup(); michael@0: is(cw.GroupItems.getActiveGroupItem(), groupItemOne, "Group one is active"); michael@0: is(gBrowser.selectedTab, pinnedTab, "Selected tab is the pinned tab"); michael@0: michael@0: finish(); michael@0: }); michael@0: }); michael@0: } michael@0: