|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 * http://creativecommons.org/publicdomain/zero/1.0/ |
|
3 */ |
|
4 |
|
5 const kButtonId = "test-tabbar-size-with-large-buttons"; |
|
6 |
|
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 } |
|
22 |
|
23 function cleanup() { |
|
24 let btn = document.getElementById(kButtonId); |
|
25 if (btn) { |
|
26 btn.remove(); |
|
27 } |
|
28 } |
|
29 |