|
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(!CustomizableUI.inDefaultState, "Should no longer be in the default state."); |
|
16 is(btn.parentNode.parentNode.id, CustomizableUI.AREA_NAVBAR, "Button should be in navbar"); |
|
17 btn.remove(); |
|
18 is(btn.parentNode, null, "Button is no longer in the navbar"); |
|
19 ok(CustomizableUI.inDefaultState, "Should be back in the default state, " + |
|
20 "despite unknown button ID in placements."); |
|
21 }); |
|
22 |
|
23 add_task(function asyncCleanup() { |
|
24 yield resetCustomization(); |
|
25 }); |