Bug 1387023 - initialize devtools before asserting menu items in browser_989751_subviewbutton_class.js;r=Gijs
MozReview-Commit-ID: 9piucVkS0Y9
--- a/browser/components/customizableui/test/browser_989751_subviewbutton_class.js
+++ b/browser/components/customizableui/test/browser_989751_subviewbutton_class.js
@@ -10,16 +10,21 @@ var tempElement = null;
function insertClassNameToMenuChildren(parentMenu) {
let el = parentMenu.querySelector("menuitem:first-of-type");
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.
+ Cu.import("resource://devtools/shared/Loader.jsm", {})
+ .require("devtools/client/framework/devtools-browser");
+
info("Checking for items without the subviewbutton class in " + buttonId + " widget");
let menu = document.getElementById(menuId);
insertClassNameToMenuChildren(menu);
let placement = CustomizableUI.getPlacementOfWidget(buttonId);
let changedPlacement = false;
if (!placement || placement.area != CustomizableUI.AREA_PANEL) {
CustomizableUI.addWidgetToArea(buttonId, CustomizableUI.AREA_PANEL);