|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 "use strict"; |
|
6 |
|
7 |
|
8 // Adding a separator and then dragging it out of the navbar shouldn't throw |
|
9 add_task(function() { |
|
10 try { |
|
11 let navbar = document.getElementById("nav-bar"); |
|
12 let separatorSelector = "toolbarseparator[id^=customizableui-special-separator]"; |
|
13 ok(!navbar.querySelector(separatorSelector), "Shouldn't be a separator in the navbar"); |
|
14 CustomizableUI.addWidgetToArea('separator', 'nav-bar'); |
|
15 yield startCustomizing(); |
|
16 let separator = navbar.querySelector(separatorSelector); |
|
17 ok(separator, "There should be a separator in the navbar now."); |
|
18 let palette = document.getElementById("customization-palette"); |
|
19 simulateItemDrag(separator, palette); |
|
20 ok(!palette.querySelector(separatorSelector), "No separator in the palette."); |
|
21 } catch (ex) { |
|
22 Cu.reportError(ex); |
|
23 ok(false, "Shouldn't throw an exception moving an item to the navbar."); |
|
24 } finally { |
|
25 yield endCustomizing(); |
|
26 } |
|
27 }); |
|
28 |
|
29 add_task(function asyncCleanup() { |
|
30 resetCustomization(); |
|
31 }); |