michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: let newTab; michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: newTab = gBrowser.addTab(); michael@0: michael@0: window.addEventListener("tabviewshown", onTabViewWindowLoaded, false); michael@0: TabView.toggle(); michael@0: } michael@0: michael@0: function onTabViewWindowLoaded() { michael@0: window.removeEventListener("tabviewshown", onTabViewWindowLoaded, false); michael@0: michael@0: let contentWindow = document.getElementById("tab-view").contentWindow; michael@0: is(contentWindow.GroupItems.groupItems.length, 1, "Has one group only"); michael@0: michael@0: let tabItems = contentWindow.GroupItems.groupItems[0].getChildren(); michael@0: ok(tabItems.length, 2, "There are two tabItems in the group"); michael@0: michael@0: is(tabItems[1].tab, newTab, "The second tabItem is linked to the new tab"); michael@0: michael@0: EventUtils.sendMouseEvent({ type: "mousedown", button: 1 }, tabItems[1].container, contentWindow); michael@0: EventUtils.sendMouseEvent({ type: "mouseup", button: 1 }, tabItems[1].container, contentWindow); michael@0: michael@0: ok(tabItems.length, 1, "There is only one tabItem in the group"); michael@0: michael@0: let endGame = function() { michael@0: window.removeEventListener("tabviewhidden", endGame, false); michael@0: michael@0: finish(); michael@0: }; michael@0: window.addEventListener("tabviewhidden", endGame, false); michael@0: TabView.toggle(); michael@0: }