forked from mirrors/gecko-dev
		
	 3f6801477a
			
		
	
	
		3f6801477a
		
	
	
	
	
		
			
			--HG-- extra : commitid : CTMv8KOMjRK extra : rebase_source : 768fb80e4652c1f0e14eea9e32da8eff795f1659 extra : amend_source : bd695a57c00c8004b048ccd4673465d66bea22c6 extra : histedit_source : ca0c6fcb719d0e7f0895de1bd429fa9804833f65
		
			
				
	
	
		
			46 lines
		
	
	
	
		
			1.6 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
	
		
			1.6 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| /* Any copyright is dedicated to the Public Domain.
 | |
|  * http://creativecommons.org/publicdomain/zero/1.0/ */
 | |
| 
 | |
| "use strict";
 | |
| 
 | |
| var draggedItem;
 | |
| 
 | |
| /**
 | |
|  * Check that customizing-movingItem gets removed on a drop when the item is moved.
 | |
|  */
 | |
| 
 | |
| // Drop on the palette
 | |
| add_task(function*() {
 | |
|   draggedItem = document.createElement("toolbarbutton");
 | |
|   draggedItem.id = "test-dragEnd-after-move1";
 | |
|   draggedItem.setAttribute("label", "Test");
 | |
|   draggedItem.setAttribute("removable", "true");
 | |
|   let navbar = document.getElementById("nav-bar");
 | |
|   navbar.customizationTarget.appendChild(draggedItem);
 | |
|   yield startCustomizing();
 | |
|   simulateItemDrag(draggedItem, gCustomizeMode.visiblePalette);
 | |
|   is(document.documentElement.hasAttribute("customizing-movingItem"), false,
 | |
|      "Make sure customizing-movingItem is removed after dragging to the palette");
 | |
|   yield endCustomizing();
 | |
| });
 | |
| 
 | |
| // Drop on a customization target itself
 | |
| add_task(function*() {
 | |
|   draggedItem = document.createElement("toolbarbutton");
 | |
|   draggedItem.id = "test-dragEnd-after-move2";
 | |
|   draggedItem.setAttribute("label", "Test");
 | |
|   draggedItem.setAttribute("removable", "true");
 | |
|   let dest = createToolbarWithPlacements("test-dragEnd");
 | |
|   let navbar = document.getElementById("nav-bar");
 | |
|   navbar.customizationTarget.appendChild(draggedItem);
 | |
|   yield startCustomizing();
 | |
|   simulateItemDrag(draggedItem, dest.customizationTarget);
 | |
|   is(document.documentElement.hasAttribute("customizing-movingItem"), false,
 | |
|      "Make sure customizing-movingItem is removed");
 | |
|   yield endCustomizing();
 | |
| });
 | |
| 
 | |
| add_task(function* asyncCleanup() {
 | |
|   yield endCustomizing();
 | |
|   yield resetCustomization();
 | |
| });
 |