diff -r 000000000000 -r 6474c204b198 browser/components/tabview/test/browser_tabview_bug634085.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/browser/components/tabview/test/browser_tabview_bug634085.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,49 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +function test() { + let numChildren = 7; + + let assertTopOfStack = function (tabItem) { + ok(!tabItem.getHidden(), "tabItem is visible"); + is(tabItem.zIndex, tabItem.parent.getZ() + numChildren + 1, "zIndex"); + } + + let testTopOfStack = function (tabItem, callback) { + hideTabView(function () { + gBrowser.selectedTab = tabItem.tab; + + showTabView(function () { + assertTopOfStack(tabItem); + callback(); + }); + }); + } + + let finishTest = function () { + registerCleanupFunction(function () { + is(1, gBrowser.tabs.length, "there is one tab, only"); + ok(!TabView.isVisible(), "tabview is not visible"); + }); + + finish(); + } + + waitForExplicitFinish(); + + showTabView(function () { + let groupItem = createGroupItemWithBlankTabs(window, 150, 150, 10, numChildren); + + registerCleanupFunction(function () { + closeGroupItem(groupItem, function () TabView.hide()); + }); + + testTopOfStack(groupItem.getChild(1), function () { + testTopOfStack(groupItem.getChild(6), function () { + closeGroupItem(groupItem, function () { + hideTabView(finishTest); + }); + }); + }); + }); +}