browser_892955_isWidgetRemovable_for_removed_widgets.js (818B)
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 const kWidgetId = "test-892955-remove-widget"; 8 9 // Removing a destroyed widget should work. 10 add_task(async function () { 11 let widgetSpec = { 12 id: kWidgetId, 13 defaultArea: CustomizableUI.AREA_NAVBAR, 14 }; 15 16 CustomizableUI.createWidget(widgetSpec); 17 CustomizableUI.destroyWidget(kWidgetId); 18 let noError = true; 19 try { 20 CustomizableUI.removeWidgetFromArea(kWidgetId); 21 } catch (ex) { 22 noError = false; 23 console.error(ex); 24 } 25 ok(noError, "Shouldn't throw an error removing a destroyed widget."); 26 }); 27 28 add_task(async function asyncCleanup() { 29 await resetCustomization(); 30 });