Bug 1361080 - filter out hidden devtools menu items in customizableui test;r=jaws
DevTools are adding a hidden menuitem "Enable DevTools..." that will be used to
propose an onboarding screen to users. This hidden button makes a customizable ui
test fail. It needs to be filtered out.
MozReview-Commit-ID: IX4SlpDHdsT
--- a/browser/components/customizableui/test/browser_989751_subviewbutton_class.js
+++ b/browser/components/customizableui/test/browser_989751_subviewbutton_class.js
@@ -3,17 +3,18 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const kCustomClass = "acustomclassnoonewilluse";
var tempElement = null;
function insertClassNameToMenuChildren(parentMenu) {
- let el = parentMenu.querySelector("menuitem:first-of-type");
+ // Skip hidden menuitem elements, not copied via fillSubviewFromMenuItems.
+ let el = parentMenu.querySelector("menuitem:not([hidden])");
el.classList.add(kCustomClass);
tempElement = el;
}
function checkSubviewButtonClass(menuId, buttonId, subviewId) {
return async function() {
// Initialize DevTools before starting the test in order to create menuitems in
// menuWebDeveloperPopup.