2011-06-17 05:07:59 -07:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
|
|
|
function test() {
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
|
|
|
newWindowWithTabView(function (win) {
|
|
|
|
registerCleanupFunction(function () win.close());
|
|
|
|
|
|
|
|
for (let i = 0; i < 4; i++)
|
|
|
|
win.gBrowser.loadOneTab("about:blank", {inBackground: true});
|
|
|
|
|
|
|
|
let cw = win.TabView.getContentWindow();
|
|
|
|
let groupItem = cw.GroupItems.groupItems[0];
|
|
|
|
let children = groupItem.getChildren();
|
|
|
|
|
|
|
|
groupItem.setSize(200, 200, true);
|
|
|
|
ok(groupItem.isStacked(), "groupItem is now stacked");
|
|
|
|
is(win.gBrowser.tabs.length, 5, "we have five tabs");
|
|
|
|
|
2011-07-14 10:54:25 -07:00
|
|
|
groupItem.addSubscriber("expanded", function onExpanded() {
|
|
|
|
groupItem.removeSubscriber("expanded", onExpanded);
|
2011-06-17 05:07:59 -07:00
|
|
|
|
|
|
|
ok(groupItem.expanded, "groupItem is expanded");
|
|
|
|
let bounds = children[1].getBounds();
|
|
|
|
|
|
|
|
// remove two tabs and see if the remaining tabs are re-arranged to fill
|
|
|
|
// the resulting gaps
|
|
|
|
for (let i = 0; i < 2; i++) {
|
2011-09-26 19:33:37 -07:00
|
|
|
EventUtils.synthesizeMouseAtCenter(children[1].container, {button: 1}, cw);
|
2011-06-17 05:07:59 -07:00
|
|
|
ok(bounds.equals(children[1].getBounds()), "tabItems were re-arranged");
|
|
|
|
}
|
|
|
|
|
|
|
|
waitForFocus(finish);
|
|
|
|
});
|
|
|
|
|
|
|
|
groupItem.expand();
|
|
|
|
});
|
|
|
|
}
|