browser_877447_skip_missing_ids.js (1089B)
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/. */ 4 5 "use strict"; 6 7 registerCleanupFunction(removeCustomToolbars); 8 9 add_task(function skipMissingIDS() { 10 const kButtonId = "look-at-me-disappear-button"; 11 CustomizableUI.reset(); 12 ok(CustomizableUI.inDefaultState, "Should be in the default state."); 13 let btn = createDummyXULButton(kButtonId, "Gone!"); 14 CustomizableUI.addWidgetToArea(kButtonId, CustomizableUI.AREA_NAVBAR); 15 ok( 16 !CustomizableUI.inDefaultState, 17 "Should no longer be in the default state." 18 ); 19 is( 20 btn.parentNode.parentNode.id, 21 CustomizableUI.AREA_NAVBAR, 22 "Button should be in navbar" 23 ); 24 btn.remove(); 25 is(btn.parentNode, null, "Button is no longer in the navbar"); 26 ok( 27 CustomizableUI.inDefaultState, 28 "Should be back in the default state, " + 29 "despite unknown button ID in placements." 30 ); 31 }); 32 33 add_task(async function asyncCleanup() { 34 await resetCustomization(); 35 });