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: michael@0: // Adding a separator and then dragging it out of the navbar shouldn't throw michael@0: add_task(function() { michael@0: try { michael@0: let navbar = document.getElementById("nav-bar"); michael@0: let separatorSelector = "toolbarseparator[id^=customizableui-special-separator]"; michael@0: ok(!navbar.querySelector(separatorSelector), "Shouldn't be a separator in the navbar"); michael@0: CustomizableUI.addWidgetToArea('separator', 'nav-bar'); michael@0: yield startCustomizing(); michael@0: let separator = navbar.querySelector(separatorSelector); michael@0: ok(separator, "There should be a separator in the navbar now."); michael@0: let palette = document.getElementById("customization-palette"); michael@0: simulateItemDrag(separator, palette); michael@0: ok(!palette.querySelector(separatorSelector), "No separator in the palette."); michael@0: } catch (ex) { michael@0: Cu.reportError(ex); michael@0: ok(false, "Shouldn't throw an exception moving an item to the navbar."); michael@0: } finally { michael@0: yield endCustomizing(); michael@0: } michael@0: }); michael@0: michael@0: add_task(function asyncCleanup() { michael@0: resetCustomization(); michael@0: });