1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/base/content/test/general/browser_tabbar_big_widgets.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,29 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + * http://creativecommons.org/publicdomain/zero/1.0/ 1.6 + */ 1.7 + 1.8 +const kButtonId = "test-tabbar-size-with-large-buttons"; 1.9 + 1.10 +function test() { 1.11 + registerCleanupFunction(cleanup); 1.12 + let titlebar = document.getElementById("titlebar"); 1.13 + let originalHeight = titlebar.getBoundingClientRect().height; 1.14 + let button = document.createElement("toolbarbutton"); 1.15 + button.id = kButtonId; 1.16 + button.setAttribute("style", "min-height: 100px"); 1.17 + gNavToolbox.palette.appendChild(button); 1.18 + CustomizableUI.addWidgetToArea(kButtonId, CustomizableUI.AREA_TABSTRIP); 1.19 + let currentHeight = titlebar.getBoundingClientRect().height; 1.20 + ok(currentHeight > originalHeight, "Titlebar should have grown"); 1.21 + CustomizableUI.removeWidgetFromArea(kButtonId); 1.22 + currentHeight = titlebar.getBoundingClientRect().height; 1.23 + is(currentHeight, originalHeight, "Titlebar should have gone back to its original size."); 1.24 +} 1.25 + 1.26 +function cleanup() { 1.27 + let btn = document.getElementById(kButtonId); 1.28 + if (btn) { 1.29 + btn.remove(); 1.30 + } 1.31 +} 1.32 +