browser/components/tabview/test/browser_tabview_bug662266.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     for (let i = 0; i < 4; i++)
    11       win.gBrowser.loadOneTab("about:blank", {inBackground: true});
    13     let cw = win.TabView.getContentWindow();
    14     let groupItem = cw.GroupItems.groupItems[0];
    15     let children = groupItem.getChildren();
    17     groupItem.setSize(200, 200, true);
    18     ok(groupItem.isStacked(), "groupItem is now stacked");
    19     is(win.gBrowser.tabs.length, 5, "we have five tabs");
    21     groupItem.addSubscriber("expanded", function onExpanded() {
    22       groupItem.removeSubscriber("expanded", onExpanded);
    24       ok(groupItem.expanded, "groupItem is expanded");
    25       let bounds = children[1].getBounds();
    27       // remove two tabs and see if the remaining tabs are re-arranged to fill
    28       // the resulting gaps
    29       for (let i = 0; i < 2; i++) {
    30         EventUtils.synthesizeMouseAtCenter(children[1].container, {button: 1}, cw);
    31         ok(bounds.equals(children[1].getBounds()), "tabItems were re-arranged");
    32       }
    34       waitForFocus(finish);
    35     });
    37     groupItem.expand();
    38   });
    39 }

mercurial