browser/base/content/test/general/browser_tabbar_big_widgets.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

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

mercurial