Bug 1387023 - initialize devtools before asserting menu items in browser_989751_subviewbutton_class.js;r=Gijs draft
authorJulian Descottes <jdescottes@mozilla.com>
Thu, 03 Aug 2017 14:04:54 +0200
changeset 620424 bea3a2a6c02fa7689b0b2437567dfb91d03701a0
parent 620349 f47f8b5a9b99692c6582763eedaefadf0af997de
child 640685 1fbfc184b5563cf85ca56a641b66a8bc0912630c
push id72025
push userjdescottes@mozilla.com
push dateThu, 03 Aug 2017 12:05:19 +0000
reviewersGijs
bugs1387023
milestone56.0a1
Bug 1387023 - initialize devtools before asserting menu items in browser_989751_subviewbutton_class.js;r=Gijs MozReview-Commit-ID: 9piucVkS0Y9
browser/components/customizableui/test/browser_989751_subviewbutton_class.js
--- 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);