browser/components/tabview/test/browser_tabview_bug622835.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_bug622835.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,44 @@
     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 +  newWindowWithTabView(onTabViewShown);
    1.11 +}
    1.12 +
    1.13 +function onTabViewShown(win) {
    1.14 +  let contentWindow = win.TabView.getContentWindow();
    1.15 +
    1.16 +  let finishTest = function () {
    1.17 +    hideTabView(function () {
    1.18 +      win.close();
    1.19 +      finish();
    1.20 +    }, win);
    1.21 +  }
    1.22 +
    1.23 +  // do not let the group arrange itself
    1.24 +  contentWindow.GroupItems.pauseArrange();
    1.25 +
    1.26 +  // let's create a groupItem small enough to get stacked
    1.27 +  let groupItem = new contentWindow.GroupItem([], {
    1.28 +    immediately: true,
    1.29 +    bounds: {left: 20, top: 20, width: 100, height: 100}
    1.30 +  });
    1.31 +
    1.32 +  contentWindow.UI.setActive(groupItem);
    1.33 +
    1.34 +  // we need seven tabs at least to reproduce this
    1.35 +  for (var i=0; i<7; i++)
    1.36 +    win.gBrowser.loadOneTab('about:blank', {inBackground: true});
    1.37 +
    1.38 +  // finally let group arrange
    1.39 +  contentWindow.GroupItems.resumeArrange();
    1.40 +
    1.41 +  let tabItem6 = groupItem.getChildren()[5];
    1.42 +  let tabItem7 = groupItem.getChildren()[6];  
    1.43 +  ok(!tabItem6.getHidden(), 'the 6th child must not be hidden');
    1.44 +  ok(tabItem7.getHidden(), 'the 7th child must be hidden');
    1.45 +
    1.46 +  finishTest();
    1.47 +}

mercurial