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

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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 }

mercurial