1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/components/tabview/test/browser_tabview_bug665502.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,33 @@ 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 + let onLoad = function (win) { 1.11 + for (let i = 0; i < 2; i++) 1.12 + win.gBrowser.addTab(); 1.13 + }; 1.14 + 1.15 + let onShow = function (win) { 1.16 + registerCleanupFunction(function () win.close()); 1.17 + 1.18 + let cw = win.TabView.getContentWindow(); 1.19 + let groupItem = cw.GroupItems.groupItems[0]; 1.20 + 1.21 + groupItem.setSize(400, 200, true); 1.22 + 1.23 + let tabItem = groupItem.getChild(0); 1.24 + let bounds = tabItem.getBounds(); 1.25 + 1.26 + is(groupItem.getActiveTab(), tabItem, "the first tab is active"); 1.27 + EventUtils.synthesizeMouseAtCenter(tabItem.container, {button: 1}, cw); 1.28 + 1.29 + is(groupItem.getChildren().indexOf(tabItem), -1, "tabItem got removed"); 1.30 + ok(bounds.equals(groupItem.getChild(0).getBounds()), "tabItem bounds didn't change"); 1.31 + 1.32 + finish(); 1.33 + }; 1.34 + 1.35 + newWindowWithTabView(onShow, onLoad); 1.36 +}