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