From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../test/browser_956602_remove_special_widget.js | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 browser/components/customizableui/test/browser_956602_remove_special_widget.js (limited to 'browser/components/customizableui/test/browser_956602_remove_special_widget.js') diff --git a/browser/components/customizableui/test/browser_956602_remove_special_widget.js b/browser/components/customizableui/test/browser_956602_remove_special_widget.js new file mode 100644 index 0000000000..237103b79e --- /dev/null +++ b/browser/components/customizableui/test/browser_956602_remove_special_widget.js @@ -0,0 +1,37 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +// Adding a separator and then dragging it out of the navbar shouldn't throw +add_task(async function () { + try { + let navbar = document.getElementById("nav-bar"); + let separatorSelector = + "toolbarseparator[id^=customizableui-special-separator]"; + ok( + !navbar.querySelector(separatorSelector), + "Shouldn't be a separator in the navbar" + ); + CustomizableUI.addWidgetToArea("separator", "nav-bar"); + await startCustomizing(); + let separator = navbar.querySelector(separatorSelector); + ok(separator, "There should be a separator in the navbar now."); + let palette = document.getElementById("customization-palette"); + simulateItemDrag(separator, palette); + ok( + !palette.querySelector(separatorSelector), + "No separator in the palette." + ); + } catch (ex) { + console.error(ex); + ok(false, "Shouldn't throw an exception moving an item to the navbar."); + } finally { + await endCustomizing(); + } +}); + +add_task(async function asyncCleanup() { + resetCustomization(); +}); -- cgit v1.2.3