browser/components/tabview/test/browser_tabview_bug662266.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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