michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: "use strict"; michael@0: michael@0: registerCleanupFunction(removeCustomToolbars); michael@0: michael@0: add_task(function skipMissingIDS() { michael@0: const kButtonId = "look-at-me-disappear-button"; michael@0: CustomizableUI.reset(); michael@0: ok(CustomizableUI.inDefaultState, "Should be in the default state."); michael@0: let btn = createDummyXULButton(kButtonId, "Gone!"); michael@0: CustomizableUI.addWidgetToArea(kButtonId, CustomizableUI.AREA_NAVBAR); michael@0: ok(!CustomizableUI.inDefaultState, "Should no longer be in the default state."); michael@0: is(btn.parentNode.parentNode.id, CustomizableUI.AREA_NAVBAR, "Button should be in navbar"); michael@0: btn.remove(); michael@0: is(btn.parentNode, null, "Button is no longer in the navbar"); michael@0: ok(CustomizableUI.inDefaultState, "Should be back in the default state, " + michael@0: "despite unknown button ID in placements."); michael@0: }); michael@0: michael@0: add_task(function asyncCleanup() { michael@0: yield resetCustomization(); michael@0: });