Bug 1497521 - Force the new flexbox inspector ON before running its tests; r=jdescottes
authorPatrick Brosset <pbrosset@mozilla.com>
Fri, 12 Oct 2018 05:04:39 +0000
changeset 489171 a37d277dfb6c70f6633366d3c6ba34ddd7aeb827
parent 489170 3c25a0b6d2699e6a335ada101fbb3b2d12ad553f
child 489172 8bd12e6c3f9979d00afb2fc699bb292a03962f0a
child 489179 3115ef0a285ec3a44c73fc0c60cb2cab11abd836
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewersjdescottes
bugs1497521
milestone64.0a1
Bug 1497521 - Force the new flexbox inspector ON before running its tests; r=jdescottes Differential Revision: https://phabricator.services.mozilla.com/D8089
devtools/client/inspector/flexbox/test/head.js
--- a/devtools/client/inspector/flexbox/test/head.js
+++ b/devtools/client/inspector/flexbox/test/head.js
@@ -5,17 +5,23 @@
 /* import-globals-from ../../test/head.js */
 "use strict";
 
 // Import the inspector's head.js first (which itself imports shared-head.js).
 Services.scriptloader.loadSubScript(
   "chrome://mochitests/content/browser/devtools/client/inspector/test/head.js",
   this);
 
+// Make sure the flexbox inspector is enabled before running the tests.
+Services.prefs.setBoolPref("devtools.flexboxinspector.enabled", true);
+
 // Make sure only the flexbox layout accordion is opened, and the others are closed.
 Services.prefs.setBoolPref("devtools.layout.flexbox.opened", true);
 Services.prefs.setBoolPref("devtools.layout.boxmodel.opened", false);
 Services.prefs.setBoolPref("devtools.layout.grid.opened", false);
+
+// Clear all set prefs.
 registerCleanupFunction(() => {
+  Services.prefs.clearUserPref("devtools.flexboxinspector.enabled");
   Services.prefs.clearUserPref("devtools.layout.flexbox.opened");
   Services.prefs.clearUserPref("devtools.layout.boxmodel.opened");
   Services.prefs.clearUserPref("devtools.layout.grid.opened");
 });