browser_934113_menubar_removable.js (1373B)
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 // Attempting to drag the menubar to the navbar shouldn't work. 8 add_task(async function () { 9 await startCustomizing(); 10 let menuItems = document.getElementById("menubar-items"); 11 let navbar = document.getElementById("nav-bar"); 12 let menubar = document.getElementById("toolbar-menubar"); 13 // Force the menu to be shown. 14 const kAutohide = menubar.getAttribute("autohide"); 15 menubar.removeAttribute("autohide"); 16 simulateItemDrag(menuItems, CustomizableUI.getCustomizationTarget(navbar)); 17 18 is( 19 getAreaWidgetIds("nav-bar").indexOf("menubar-items"), 20 -1, 21 "Menu bar shouldn't be in the navbar." 22 ); 23 ok( 24 !navbar.querySelector("#menubar-items"), 25 "Shouldn't find menubar items in the navbar." 26 ); 27 ok( 28 menubar.querySelector("#menubar-items"), 29 "Should find menubar items in the menubar." 30 ); 31 isnot( 32 getAreaWidgetIds("toolbar-menubar").indexOf("menubar-items"), 33 -1, 34 "Menubar items shouldn't be missing from the navbar." 35 ); 36 menubar.setAttribute("autohide", kAutohide); 37 await endCustomizing(); 38 }); 39 40 add_task(async function asyncCleanup() { 41 await endCustomizing(); 42 await resetCustomization(); 43 });