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: const kWidgetId = "test-non-removable-widget"; michael@0: michael@0: // Adding non-removable items to a toolbar or the panel shouldn't change inDefaultState michael@0: add_task(function() { michael@0: let navbar = document.getElementById("nav-bar"); michael@0: ok(CustomizableUI.inDefaultState, "Should start in default state"); michael@0: michael@0: let button = createDummyXULButton(kWidgetId, "Test non-removable inDefaultState handling"); michael@0: CustomizableUI.addWidgetToArea(kWidgetId, CustomizableUI.AREA_NAVBAR); michael@0: button.setAttribute("removable", "false"); michael@0: ok(CustomizableUI.inDefaultState, "Should still be in default state after navbar addition"); michael@0: button.remove(); michael@0: michael@0: button = createDummyXULButton(kWidgetId, "Test non-removable inDefaultState handling"); michael@0: CustomizableUI.addWidgetToArea(kWidgetId, CustomizableUI.AREA_PANEL); michael@0: button.setAttribute("removable", "false"); michael@0: ok(CustomizableUI.inDefaultState, "Should still be in default state after panel addition"); michael@0: button.remove(); michael@0: ok(CustomizableUI.inDefaultState, "Should be in default state after destroying both widgets"); michael@0: });