browser/components/customizableui/test/browser_938995_indefaultstate_nonremovable.js

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 "use strict";
     7 const kWidgetId = "test-non-removable-widget";
     9 // Adding non-removable items to a toolbar or the panel shouldn't change inDefaultState
    10 add_task(function() {
    11   let navbar = document.getElementById("nav-bar");
    12   ok(CustomizableUI.inDefaultState, "Should start in default state");
    14   let button = createDummyXULButton(kWidgetId, "Test non-removable inDefaultState handling");
    15   CustomizableUI.addWidgetToArea(kWidgetId, CustomizableUI.AREA_NAVBAR);
    16   button.setAttribute("removable", "false");
    17   ok(CustomizableUI.inDefaultState, "Should still be in default state after navbar addition");
    18   button.remove();
    20   button = createDummyXULButton(kWidgetId, "Test non-removable inDefaultState handling");
    21   CustomizableUI.addWidgetToArea(kWidgetId, CustomizableUI.AREA_PANEL);
    22   button.setAttribute("removable", "false");
    23   ok(CustomizableUI.inDefaultState, "Should still be in default state after panel addition");
    24   button.remove();
    25   ok(CustomizableUI.inDefaultState, "Should be in default state after destroying both widgets");
    26 });

mercurial