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: showTabView(function() { michael@0: registerCleanupFunction(function() { michael@0: if (gBrowser.tabs[1]) michael@0: gBrowser.removeTab(gBrowser.tabs[1]); michael@0: TabView.hide(); michael@0: }); michael@0: michael@0: let contentWindow = TabView.getContentWindow(); michael@0: let groupItem = createEmptyGroupItem(contentWindow, 200, 200, 20); michael@0: contentWindow.GroupItems.setActiveGroupItem(groupItem); michael@0: michael@0: // A new tab should be added to the active group and tabview should zoom into it. michael@0: is(groupItem.getChildren().length, 0, "This group doesn't have any tabitems"); michael@0: whenTabViewIsHidden(function() { michael@0: is(groupItem.getChildren().length, 1, "This group has one tabitem"); michael@0: michael@0: showTabView(function() { michael@0: // Ensure that no new tab is added to this non-empty tab group. michael@0: whenTabViewIsHidden(function() { michael@0: let tabItems = groupItem.getChildren(); michael@0: is(tabItems.length, 1, "This group has one tabitem"); michael@0: is(tabItems[0].tab, gBrowser.selectedTab, "The same tab"); michael@0: michael@0: tabItems[0].close(); michael@0: groupItem.close(); michael@0: michael@0: finish(); michael@0: }); michael@0: EventUtils.synthesizeKey("VK_RETURN", {}, contentWindow); michael@0: }); michael@0: }); michael@0: EventUtils.synthesizeKey("VK_RETURN", {}, contentWindow); michael@0: }); michael@0: } michael@0: