2011-02-14 09:21:37 -08:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
|
|
|
function test() {
|
2011-04-13 21:10:50 -07:00
|
|
|
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 + ")");
|
|
|
|
});
|
|
|
|
}
|
2011-02-14 09:21:37 -08:00
|
|
|
|
2011-04-13 21:10:50 -07:00
|
|
|
waitForExplicitFinish();
|
2011-02-14 09:21:37 -08:00
|
|
|
|
2011-04-13 21:10:50 -07:00
|
|
|
newWindowWithTabView(function (win) {
|
|
|
|
registerCleanupFunction(function () win.close());
|
2011-02-14 09:21:37 -08:00
|
|
|
|
2011-04-13 21:10:50 -07:00
|
|
|
let numTabsToUpdate = 10;
|
|
|
|
let groupItem = createGroupItemWithBlankTabs(win, 150, 150, 100, numTabsToUpdate, false);
|
|
|
|
ok(groupItem.isStacked(), "groupItem is stacked");
|
2011-02-14 09:21:37 -08:00
|
|
|
|
2011-04-13 21:10:50 -07:00
|
|
|
let cw = win.TabView.getContentWindow();
|
|
|
|
cw.TabItems.pausePainting();
|
2011-02-14 09:21:37 -08:00
|
|
|
|
2011-04-13 21:10:50 -07:00
|
|
|
groupItem.getChildren().forEach(function (tabItem) {
|
2011-07-14 10:54:25 -07:00
|
|
|
tabItem.addSubscriber("updated", function onUpdated() {
|
|
|
|
tabItem.removeSubscriber("updated", onUpdated);
|
2011-04-13 21:10:50 -07:00
|
|
|
tabItem._testLastTabUpdateTime = tabItem._lastTabUpdateTime;
|
2011-02-14 09:21:37 -08:00
|
|
|
|
2011-04-13 21:10:50 -07:00
|
|
|
if (--numTabsToUpdate)
|
|
|
|
return;
|
2011-02-14 09:21:37 -08:00
|
|
|
|
2011-04-13 21:10:50 -07:00
|
|
|
checkUpdateTimes(groupItem);
|
|
|
|
finish();
|
|
|
|
});
|
2011-02-14 09:21:37 -08:00
|
|
|
|
2011-04-13 21:10:50 -07:00
|
|
|
cw.TabItems.update(tabItem.tab);
|
|
|
|
});
|
2011-02-14 09:21:37 -08:00
|
|
|
|
2011-04-13 21:10:50 -07:00
|
|
|
cw.TabItems.resumePainting();
|
2011-02-14 09:21:37 -08:00
|
|
|
});
|
|
|
|
}
|