mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
5ec5310498
--HG-- extra : rebase_source : aad2a9b54a69182f75de437cf0f15316729ca64a
46 lines
1.3 KiB
JavaScript
46 lines
1.3 KiB
JavaScript
/* 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();
|
|
});
|
|
}
|