browser/components/tabview/test/browser_tabview_bug654941.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/components/tabview/test/browser_tabview_bug654941.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,33 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +function test() {
     1.8 +  waitForExplicitFinish();
     1.9 +
    1.10 +  let compareCanvasSize = function (prefix, width, height, tabItem) {
    1.11 +    let canvas = tabItem.$canvas[0];
    1.12 +    is(canvas.width, width, prefix + ": canvas widths are equal (" + width + "px)");
    1.13 +    is(canvas.height, height, prefix + ": canvas heights are equal (" + height + "px)");
    1.14 +  };
    1.15 +
    1.16 +  newWindowWithTabView(function (win) {
    1.17 +    registerCleanupFunction(function () win.close());
    1.18 +
    1.19 +    let cw = win.TabView.getContentWindow();
    1.20 +    let groupItem = cw.GroupItems.groupItems[0];
    1.21 +    let tabItem = groupItem.getChild(0);
    1.22 +
    1.23 +    afterAllTabItemsUpdated(function () {
    1.24 +      let {width, height} = tabItem.$canvas[0];
    1.25 +
    1.26 +      hideGroupItem(groupItem, function () {
    1.27 +        compareCanvasSize("hidden", width, height, tabItem);
    1.28 +
    1.29 +        unhideGroupItem(groupItem, function () {
    1.30 +          compareCanvasSize("unhidden", width, height, tabItem);
    1.31 +          finish();
    1.32 +        });
    1.33 +      });
    1.34 +    }, win);
    1.35 +  });
    1.36 +}

mercurial