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: window.addEventListener("tabviewshown", onTabViewWindowLoaded, false); michael@0: TabView.toggle(); michael@0: } michael@0: michael@0: function endGame() { michael@0: window.removeEventListener("tabviewhidden", endGame, false); michael@0: ok(!TabView.isVisible(), "Tab View is hidden"); michael@0: michael@0: finish(); michael@0: }; michael@0: michael@0: function onTabViewWindowLoaded() { michael@0: window.removeEventListener("tabviewshown", onTabViewWindowLoaded, false); michael@0: ok(TabView.isVisible(), "Tab View is visible"); michael@0: michael@0: let contentWindow = document.getElementById("tab-view").contentWindow; michael@0: michael@0: // establish initial state michael@0: is(contentWindow.GroupItems.groupItems.length, 1, michael@0: "we start with one group (the default)"); michael@0: is(gBrowser.tabs.length, 1, "we start with one tab"); michael@0: let originalTab = gBrowser.tabs[0]; michael@0: michael@0: let bg = contentWindow.document.getElementById("bg"); michael@0: michael@0: EventUtils.sendMouseEvent({ type: "click" }, bg, contentWindow); michael@0: michael@0: is(contentWindow.GroupItems.groupItems.length, 1, michael@0: "we should still only have one group"); michael@0: michael@0: window.addEventListener("tabviewhidden", endGame, false); michael@0: TabView.toggle(); michael@0: }