michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: "use strict"; michael@0: michael@0: let navbar; michael@0: let skippedItem; michael@0: michael@0: // Attempting to drag a skipintoolbarset item should work. michael@0: add_task(function() { michael@0: navbar = document.getElementById("nav-bar"); michael@0: skippedItem = document.createElement("toolbarbutton"); michael@0: skippedItem.id = "test-skipintoolbarset-item"; michael@0: skippedItem.setAttribute("label", "Test"); michael@0: skippedItem.setAttribute("skipintoolbarset", "true"); michael@0: skippedItem.setAttribute("removable", "true"); michael@0: navbar.customizationTarget.appendChild(skippedItem); michael@0: let downloadsButton = document.getElementById("downloads-button"); michael@0: yield startCustomizing(); michael@0: ok(CustomizableUI.inDefaultState, "Should still be in default state"); michael@0: simulateItemDrag(skippedItem, downloadsButton); michael@0: ok(CustomizableUI.inDefaultState, "Should still be in default state"); michael@0: let skippedItemWrapper = skippedItem.parentNode; michael@0: is(skippedItemWrapper.nextSibling && skippedItemWrapper.nextSibling.id, michael@0: downloadsButton.parentNode.id, "Should be next to downloads button"); michael@0: simulateItemDrag(downloadsButton, skippedItem); michael@0: let downloadWrapper = downloadsButton.parentNode; michael@0: is(downloadWrapper.nextSibling && downloadWrapper.nextSibling.id, michael@0: skippedItem.parentNode.id, "Should be next to skipintoolbarset item"); michael@0: ok(CustomizableUI.inDefaultState, "Should still be in default state"); michael@0: }); michael@0: michael@0: add_task(function asyncCleanup() { michael@0: yield endCustomizing(); michael@0: skippedItem.remove(); michael@0: yield resetCustomization(); michael@0: });