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.
1 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/
3 */
5 const kButtonId = "test-tabbar-size-with-large-buttons";
7 function test() {
8 registerCleanupFunction(cleanup);
9 let titlebar = document.getElementById("titlebar");
10 let originalHeight = titlebar.getBoundingClientRect().height;
11 let button = document.createElement("toolbarbutton");
12 button.id = kButtonId;
13 button.setAttribute("style", "min-height: 100px");
14 gNavToolbox.palette.appendChild(button);
15 CustomizableUI.addWidgetToArea(kButtonId, CustomizableUI.AREA_TABSTRIP);
16 let currentHeight = titlebar.getBoundingClientRect().height;
17 ok(currentHeight > originalHeight, "Titlebar should have grown");
18 CustomizableUI.removeWidgetFromArea(kButtonId);
19 currentHeight = titlebar.getBoundingClientRect().height;
20 is(currentHeight, originalHeight, "Titlebar should have gone back to its original size.");
21 }
23 function cleanup() {
24 let btn = document.getElementById(kButtonId);
25 if (btn) {
26 btn.remove();
27 }
28 }