michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: michael@0: const kButtonId = "test-tabbar-size-with-large-buttons"; michael@0: michael@0: function test() { michael@0: registerCleanupFunction(cleanup); michael@0: let titlebar = document.getElementById("titlebar"); michael@0: let originalHeight = titlebar.getBoundingClientRect().height; michael@0: let button = document.createElement("toolbarbutton"); michael@0: button.id = kButtonId; michael@0: button.setAttribute("style", "min-height: 100px"); michael@0: gNavToolbox.palette.appendChild(button); michael@0: CustomizableUI.addWidgetToArea(kButtonId, CustomizableUI.AREA_TABSTRIP); michael@0: let currentHeight = titlebar.getBoundingClientRect().height; michael@0: ok(currentHeight > originalHeight, "Titlebar should have grown"); michael@0: CustomizableUI.removeWidgetFromArea(kButtonId); michael@0: currentHeight = titlebar.getBoundingClientRect().height; michael@0: is(currentHeight, originalHeight, "Titlebar should have gone back to its original size."); michael@0: } michael@0: michael@0: function cleanup() { michael@0: let btn = document.getElementById(kButtonId); michael@0: if (btn) { michael@0: btn.remove(); michael@0: } michael@0: } michael@0: