diff -r 000000000000 -r 6474c204b198 browser/components/tabview/test/browser_tabview_bug662266.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/browser/components/tabview/test/browser_tabview_bug662266.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,39 @@ +/* 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"); + + groupItem.addSubscriber("expanded", function onExpanded() { + groupItem.removeSubscriber("expanded", onExpanded); + + 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++) { + EventUtils.synthesizeMouseAtCenter(children[1].container, {button: 1}, cw); + ok(bounds.equals(children[1].getBounds()), "tabItems were re-arranged"); + } + + waitForFocus(finish); + }); + + groupItem.expand(); + }); +}