browser/components/tabview/test/browser_tabview_bug662266.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:745c7a325a09
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 function test() {
5 waitForExplicitFinish();
6
7 newWindowWithTabView(function (win) {
8 registerCleanupFunction(function () win.close());
9
10 for (let i = 0; i < 4; i++)
11 win.gBrowser.loadOneTab("about:blank", {inBackground: true});
12
13 let cw = win.TabView.getContentWindow();
14 let groupItem = cw.GroupItems.groupItems[0];
15 let children = groupItem.getChildren();
16
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");
20
21 groupItem.addSubscriber("expanded", function onExpanded() {
22 groupItem.removeSubscriber("expanded", onExpanded);
23
24 ok(groupItem.expanded, "groupItem is expanded");
25 let bounds = children[1].getBounds();
26
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 }
33
34 waitForFocus(finish);
35 });
36
37 groupItem.expand();
38 });
39 }

mercurial