browser/components/tabview/test/browser_tabview_bug622835.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(onTabViewShown);
     8 }
    10 function onTabViewShown(win) {
    11   let contentWindow = win.TabView.getContentWindow();
    13   let finishTest = function () {
    14     hideTabView(function () {
    15       win.close();
    16       finish();
    17     }, win);
    18   }
    20   // do not let the group arrange itself
    21   contentWindow.GroupItems.pauseArrange();
    23   // let's create a groupItem small enough to get stacked
    24   let groupItem = new contentWindow.GroupItem([], {
    25     immediately: true,
    26     bounds: {left: 20, top: 20, width: 100, height: 100}
    27   });
    29   contentWindow.UI.setActive(groupItem);
    31   // we need seven tabs at least to reproduce this
    32   for (var i=0; i<7; i++)
    33     win.gBrowser.loadOneTab('about:blank', {inBackground: true});
    35   // finally let group arrange
    36   contentWindow.GroupItems.resumeArrange();
    38   let tabItem6 = groupItem.getChildren()[5];
    39   let tabItem7 = groupItem.getChildren()[6];  
    40   ok(!tabItem6.getHidden(), 'the 6th child must not be hidden');
    41   ok(tabItem7.getHidden(), 'the 7th child must be hidden');
    43   finishTest();
    44 }

mercurial