browser/components/tabview/test/browser_tabview_bug602432.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial