Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | * http://creativecommons.org/publicdomain/zero/1.0/ |
michael@0 | 3 | */ |
michael@0 | 4 | |
michael@0 | 5 | const kButtonId = "test-tabbar-size-with-large-buttons"; |
michael@0 | 6 | |
michael@0 | 7 | function test() { |
michael@0 | 8 | registerCleanupFunction(cleanup); |
michael@0 | 9 | let titlebar = document.getElementById("titlebar"); |
michael@0 | 10 | let originalHeight = titlebar.getBoundingClientRect().height; |
michael@0 | 11 | let button = document.createElement("toolbarbutton"); |
michael@0 | 12 | button.id = kButtonId; |
michael@0 | 13 | button.setAttribute("style", "min-height: 100px"); |
michael@0 | 14 | gNavToolbox.palette.appendChild(button); |
michael@0 | 15 | CustomizableUI.addWidgetToArea(kButtonId, CustomizableUI.AREA_TABSTRIP); |
michael@0 | 16 | let currentHeight = titlebar.getBoundingClientRect().height; |
michael@0 | 17 | ok(currentHeight > originalHeight, "Titlebar should have grown"); |
michael@0 | 18 | CustomizableUI.removeWidgetFromArea(kButtonId); |
michael@0 | 19 | currentHeight = titlebar.getBoundingClientRect().height; |
michael@0 | 20 | is(currentHeight, originalHeight, "Titlebar should have gone back to its original size."); |
michael@0 | 21 | } |
michael@0 | 22 | |
michael@0 | 23 | function cleanup() { |
michael@0 | 24 | let btn = document.getElementById(kButtonId); |
michael@0 | 25 | if (btn) { |
michael@0 | 26 | btn.remove(); |
michael@0 | 27 | } |
michael@0 | 28 | } |
michael@0 | 29 |