browser_reset_builtin_widget_currentArea.js (889B)
1 /* Any copyright is dedicated to the Public Domain. 2 * https://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Check that if we move a non-default, but builtin, widget to another area, 7 // and then reset things, the currentArea is updated correctly. 8 add_task(async function reset_should_not_keep_currentArea() { 9 CustomizableUI.addWidgetToArea( 10 "save-page-button", 11 CustomizableUI.AREA_FIXED_OVERFLOW_PANEL 12 ); 13 // We can't check currentArea directly; check areaType which is based on it: 14 is( 15 CustomizableUI.getWidget("save-page-button").areaType, 16 CustomizableUI.TYPE_PANEL, 17 "Button should know it's in the overflow panel" 18 ); 19 CustomizableUI.reset(); 20 ok( 21 !CustomizableUI.getWidget("save-page-button").areaType, 22 "Button should know it's not in the overflow panel anymore" 23 ); 24 }); 25 26 registerCleanupFunction(() => CustomizableUI.reset());