1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/components/customizableui/test/browser_877447_skip_missing_ids.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,25 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +"use strict"; 1.9 + 1.10 +registerCleanupFunction(removeCustomToolbars); 1.11 + 1.12 +add_task(function skipMissingIDS() { 1.13 + const kButtonId = "look-at-me-disappear-button"; 1.14 + CustomizableUI.reset(); 1.15 + ok(CustomizableUI.inDefaultState, "Should be in the default state."); 1.16 + let btn = createDummyXULButton(kButtonId, "Gone!"); 1.17 + CustomizableUI.addWidgetToArea(kButtonId, CustomizableUI.AREA_NAVBAR); 1.18 + ok(!CustomizableUI.inDefaultState, "Should no longer be in the default state."); 1.19 + is(btn.parentNode.parentNode.id, CustomizableUI.AREA_NAVBAR, "Button should be in navbar"); 1.20 + btn.remove(); 1.21 + is(btn.parentNode, null, "Button is no longer in the navbar"); 1.22 + ok(CustomizableUI.inDefaultState, "Should be back in the default state, " + 1.23 + "despite unknown button ID in placements."); 1.24 +}); 1.25 + 1.26 +add_task(function asyncCleanup() { 1.27 + yield resetCustomization(); 1.28 +});