Thu, 22 Jan 2015 13:21:57 +0100
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 }