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