browser/components/tabview/test/browser_tabview_bug648882.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   waitForExplicitFinish();
     7   newWindowWithTabView(function (win) {
     8     registerCleanupFunction(function () win.close());
    10     let cw = win.TabView.getContentWindow();
    11     let tab = win.gBrowser.tabs[0];
    12     let tabItem = tab._tabViewTabItem;
    13     let isIdle = false;
    15     // We replace UI.isIdle() here to not rely on setTimeout(). While this
    16     // function returns false (busy) we expect no tabItem updates to happen.
    17     let busyCount = 5;
    18     cw.UI.isIdle = function () {
    19       return isIdle = (0 > --busyCount);
    20     };
    22     cw.TabItems.pausePainting();
    24     tabItem.addSubscriber("updated", function onUpdated() {
    25       tabItem.removeSubscriber("updated", onUpdated);
    26       ok(isIdle, "tabItem is updated only when UI is idle");
    27       finish();
    28     });
    30     cw.TabItems.update(tab);
    31     cw.TabItems.resumePainting();
    32   });
    33 }

mercurial