1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/components/customizableui/test/browser_927717_customize_drag_empty_toolbar.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,26 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +"use strict"; 1.9 + 1.10 +const kTestToolbarId = "test-empty-drag"; 1.11 + 1.12 +// Attempting to drag an item to an empty container should work. 1.13 +add_task(function() { 1.14 + yield createToolbarWithPlacements(kTestToolbarId, []); 1.15 + yield startCustomizing(); 1.16 + let downloadButton = document.getElementById("downloads-button"); 1.17 + let customToolbar = document.getElementById(kTestToolbarId); 1.18 + simulateItemDrag(downloadButton, customToolbar); 1.19 + assertAreaPlacements(kTestToolbarId, ["downloads-button"]); 1.20 + ok(downloadButton.parentNode && downloadButton.parentNode.parentNode == customToolbar, 1.21 + "Button should really be in toolbar"); 1.22 + yield endCustomizing(); 1.23 + removeCustomToolbars(); 1.24 +}); 1.25 + 1.26 +add_task(function asyncCleanup() { 1.27 + yield endCustomizing(); 1.28 + yield resetCustomization(); 1.29 +});