1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/components/tabview/test/browser_tabview_bug662266.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,39 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +function test() { 1.8 + waitForExplicitFinish(); 1.9 + 1.10 + newWindowWithTabView(function (win) { 1.11 + registerCleanupFunction(function () win.close()); 1.12 + 1.13 + for (let i = 0; i < 4; i++) 1.14 + win.gBrowser.loadOneTab("about:blank", {inBackground: true}); 1.15 + 1.16 + let cw = win.TabView.getContentWindow(); 1.17 + let groupItem = cw.GroupItems.groupItems[0]; 1.18 + let children = groupItem.getChildren(); 1.19 + 1.20 + groupItem.setSize(200, 200, true); 1.21 + ok(groupItem.isStacked(), "groupItem is now stacked"); 1.22 + is(win.gBrowser.tabs.length, 5, "we have five tabs"); 1.23 + 1.24 + groupItem.addSubscriber("expanded", function onExpanded() { 1.25 + groupItem.removeSubscriber("expanded", onExpanded); 1.26 + 1.27 + ok(groupItem.expanded, "groupItem is expanded"); 1.28 + let bounds = children[1].getBounds(); 1.29 + 1.30 + // remove two tabs and see if the remaining tabs are re-arranged to fill 1.31 + // the resulting gaps 1.32 + for (let i = 0; i < 2; i++) { 1.33 + EventUtils.synthesizeMouseAtCenter(children[1].container, {button: 1}, cw); 1.34 + ok(bounds.equals(children[1].getBounds()), "tabItems were re-arranged"); 1.35 + } 1.36 + 1.37 + waitForFocus(finish); 1.38 + }); 1.39 + 1.40 + groupItem.expand(); 1.41 + }); 1.42 +}