browser_969661_character_encoding_navbar_disabled.js (1099B)
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 // Adding the character encoding menu to the panel, exiting customize mode, 8 // and moving it to the nav-bar should have it disabled if the page in the 9 // content area isn't eligible to have its encoding overridden. 10 add_task(async function () { 11 await startCustomizing(); 12 CustomizableUI.addWidgetToArea( 13 "characterencoding-button", 14 CustomizableUI.AREA_FIXED_OVERFLOW_PANEL 15 ); 16 await endCustomizing(); 17 await document.getElementById("nav-bar").overflowable.show(); 18 let panelHiddenPromise = promiseOverflowHidden(window); 19 PanelUI.overflowPanel.hidePopup(); 20 await panelHiddenPromise; 21 CustomizableUI.addWidgetToArea("characterencoding-button", "nav-bar"); 22 let button = document.getElementById("characterencoding-button"); 23 ok(button.hasAttribute("disabled"), "Button should be disabled"); 24 }); 25 26 add_task(function asyncCleanup() { 27 resetCustomization(); 28 });