michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: "use strict"; michael@0: michael@0: let draggedItem; michael@0: michael@0: /** michael@0: * Check that customizing-movingItem gets removed on a drop when the item is moved. michael@0: */ michael@0: michael@0: // Drop on the palette michael@0: add_task(function() { michael@0: draggedItem = document.createElement("toolbarbutton"); michael@0: draggedItem.id = "test-dragEnd-after-move1"; michael@0: draggedItem.setAttribute("label", "Test"); michael@0: draggedItem.setAttribute("removable", "true"); michael@0: let navbar = document.getElementById("nav-bar"); michael@0: navbar.customizationTarget.appendChild(draggedItem); michael@0: yield startCustomizing(); michael@0: simulateItemDrag(draggedItem, gCustomizeMode.visiblePalette); michael@0: is(document.documentElement.hasAttribute("customizing-movingItem"), false, michael@0: "Make sure customizing-movingItem is removed after dragging to the palette"); michael@0: }); michael@0: michael@0: // Drop on a customization target itself michael@0: add_task(function() { michael@0: draggedItem = document.createElement("toolbarbutton"); michael@0: draggedItem.id = "test-dragEnd-after-move2"; michael@0: draggedItem.setAttribute("label", "Test"); michael@0: draggedItem.setAttribute("removable", "true"); michael@0: let dest = createToolbarWithPlacements("test-dragEnd"); michael@0: let navbar = document.getElementById("nav-bar"); michael@0: navbar.customizationTarget.appendChild(draggedItem); michael@0: yield startCustomizing(); michael@0: simulateItemDrag(draggedItem, dest.customizationTarget); michael@0: is(document.documentElement.hasAttribute("customizing-movingItem"), false, michael@0: "Make sure customizing-movingItem is removed"); michael@0: }); michael@0: michael@0: add_task(function asyncCleanup() { michael@0: yield endCustomizing(); michael@0: yield resetCustomization(); michael@0: });