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 checkUpdateTimes = function (groupItem) { michael@0: let children = groupItem.getChildren(); michael@0: let earliestUpdateTime = children.shift()._testLastTabUpdateTime; michael@0: michael@0: children.forEach(function (tabItem) { michael@0: let updateTime = tabItem._testLastTabUpdateTime; michael@0: ok(earliestUpdateTime <= updateTime, "Stacked group item update (" + michael@0: updateTime + ") > first item (" + earliestUpdateTime + ")"); michael@0: }); michael@0: } michael@0: michael@0: waitForExplicitFinish(); michael@0: michael@0: newWindowWithTabView(function (win) { michael@0: registerCleanupFunction(function () win.close()); michael@0: michael@0: let numTabsToUpdate = 10; michael@0: let groupItem = createGroupItemWithBlankTabs(win, 150, 150, 100, numTabsToUpdate, false); michael@0: ok(groupItem.isStacked(), "groupItem is stacked"); michael@0: michael@0: let cw = win.TabView.getContentWindow(); michael@0: cw.TabItems.pausePainting(); michael@0: michael@0: groupItem.getChildren().forEach(function (tabItem) { michael@0: tabItem.addSubscriber("updated", function onUpdated() { michael@0: tabItem.removeSubscriber("updated", onUpdated); michael@0: tabItem._testLastTabUpdateTime = tabItem._lastTabUpdateTime; michael@0: michael@0: if (--numTabsToUpdate) michael@0: return; michael@0: michael@0: checkUpdateTimes(groupItem); michael@0: finish(); michael@0: }); michael@0: michael@0: cw.TabItems.update(tabItem.tab); michael@0: }); michael@0: michael@0: cw.TabItems.resumePainting(); michael@0: }); michael@0: }