browser/components/customizableui/test/browser_978084_dragEnd_after_move.js

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

michael@0 1 /* Any copyright is dedicated to the Public Domain.
michael@0 2 * http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 3
michael@0 4 "use strict";
michael@0 5
michael@0 6 let draggedItem;
michael@0 7
michael@0 8 /**
michael@0 9 * Check that customizing-movingItem gets removed on a drop when the item is moved.
michael@0 10 */
michael@0 11
michael@0 12 // Drop on the palette
michael@0 13 add_task(function() {
michael@0 14 draggedItem = document.createElement("toolbarbutton");
michael@0 15 draggedItem.id = "test-dragEnd-after-move1";
michael@0 16 draggedItem.setAttribute("label", "Test");
michael@0 17 draggedItem.setAttribute("removable", "true");
michael@0 18 let navbar = document.getElementById("nav-bar");
michael@0 19 navbar.customizationTarget.appendChild(draggedItem);
michael@0 20 yield startCustomizing();
michael@0 21 simulateItemDrag(draggedItem, gCustomizeMode.visiblePalette);
michael@0 22 is(document.documentElement.hasAttribute("customizing-movingItem"), false,
michael@0 23 "Make sure customizing-movingItem is removed after dragging to the palette");
michael@0 24 });
michael@0 25
michael@0 26 // Drop on a customization target itself
michael@0 27 add_task(function() {
michael@0 28 draggedItem = document.createElement("toolbarbutton");
michael@0 29 draggedItem.id = "test-dragEnd-after-move2";
michael@0 30 draggedItem.setAttribute("label", "Test");
michael@0 31 draggedItem.setAttribute("removable", "true");
michael@0 32 let dest = createToolbarWithPlacements("test-dragEnd");
michael@0 33 let navbar = document.getElementById("nav-bar");
michael@0 34 navbar.customizationTarget.appendChild(draggedItem);
michael@0 35 yield startCustomizing();
michael@0 36 simulateItemDrag(draggedItem, dest.customizationTarget);
michael@0 37 is(document.documentElement.hasAttribute("customizing-movingItem"), false,
michael@0 38 "Make sure customizing-movingItem is removed");
michael@0 39 });
michael@0 40
michael@0 41 add_task(function asyncCleanup() {
michael@0 42 yield endCustomizing();
michael@0 43 yield resetCustomization();
michael@0 44 });

mercurial