|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 function test() { |
|
5 let checkUpdateTimes = function (groupItem) { |
|
6 let children = groupItem.getChildren(); |
|
7 let earliestUpdateTime = children.shift()._testLastTabUpdateTime; |
|
8 |
|
9 children.forEach(function (tabItem) { |
|
10 let updateTime = tabItem._testLastTabUpdateTime; |
|
11 ok(earliestUpdateTime <= updateTime, "Stacked group item update (" + |
|
12 updateTime + ") > first item (" + earliestUpdateTime + ")"); |
|
13 }); |
|
14 } |
|
15 |
|
16 waitForExplicitFinish(); |
|
17 |
|
18 newWindowWithTabView(function (win) { |
|
19 registerCleanupFunction(function () win.close()); |
|
20 |
|
21 let numTabsToUpdate = 10; |
|
22 let groupItem = createGroupItemWithBlankTabs(win, 150, 150, 100, numTabsToUpdate, false); |
|
23 ok(groupItem.isStacked(), "groupItem is stacked"); |
|
24 |
|
25 let cw = win.TabView.getContentWindow(); |
|
26 cw.TabItems.pausePainting(); |
|
27 |
|
28 groupItem.getChildren().forEach(function (tabItem) { |
|
29 tabItem.addSubscriber("updated", function onUpdated() { |
|
30 tabItem.removeSubscriber("updated", onUpdated); |
|
31 tabItem._testLastTabUpdateTime = tabItem._lastTabUpdateTime; |
|
32 |
|
33 if (--numTabsToUpdate) |
|
34 return; |
|
35 |
|
36 checkUpdateTimes(groupItem); |
|
37 finish(); |
|
38 }); |
|
39 |
|
40 cw.TabItems.update(tabItem.tab); |
|
41 }); |
|
42 |
|
43 cw.TabItems.resumePainting(); |
|
44 }); |
|
45 } |