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 newTab; michael@0: michael@0: let onLoad = function (win) { michael@0: registerCleanupFunction(function () win.close()); michael@0: michael@0: newTab = win.gBrowser.addTab(); michael@0: michael@0: let popup = win.document.getElementById("context_tabViewMenuPopup"); michael@0: win.TabView.updateContextMenu(newTab, popup); michael@0: }; michael@0: michael@0: let onShow = function (win) { michael@0: let cw = win.TabView.getContentWindow(); michael@0: is(cw.GroupItems.groupItems.length, 1, "Has only one group"); michael@0: michael@0: let groupItem = cw.GroupItems.groupItems[0]; michael@0: let tabItems = groupItem.getChildren(); michael@0: michael@0: let tab = tabItems[tabItems.length - 1].tab; michael@0: is(tab, newTab, "The new tab exists in the group"); michael@0: michael@0: finish(); michael@0: }; michael@0: michael@0: waitForExplicitFinish(); michael@0: newWindowWithTabView(onShow, onLoad); michael@0: }