diff -r 000000000000 -r 6474c204b198 browser/components/tabview/test/browser_tabview_bug602432.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/browser/components/tabview/test/browser_tabview_bug602432.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,45 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +function test() { + let checkUpdateTimes = function (groupItem) { + let children = groupItem.getChildren(); + let earliestUpdateTime = children.shift()._testLastTabUpdateTime; + + children.forEach(function (tabItem) { + let updateTime = tabItem._testLastTabUpdateTime; + ok(earliestUpdateTime <= updateTime, "Stacked group item update (" + + updateTime + ") > first item (" + earliestUpdateTime + ")"); + }); + } + + waitForExplicitFinish(); + + newWindowWithTabView(function (win) { + registerCleanupFunction(function () win.close()); + + let numTabsToUpdate = 10; + let groupItem = createGroupItemWithBlankTabs(win, 150, 150, 100, numTabsToUpdate, false); + ok(groupItem.isStacked(), "groupItem is stacked"); + + let cw = win.TabView.getContentWindow(); + cw.TabItems.pausePainting(); + + groupItem.getChildren().forEach(function (tabItem) { + tabItem.addSubscriber("updated", function onUpdated() { + tabItem.removeSubscriber("updated", onUpdated); + tabItem._testLastTabUpdateTime = tabItem._lastTabUpdateTime; + + if (--numTabsToUpdate) + return; + + checkUpdateTimes(groupItem); + finish(); + }); + + cw.TabItems.update(tabItem.tab); + }); + + cw.TabItems.resumePainting(); + }); +}