Bug 1551167 - Move import of mochitest/helpers/context.js to test instead of head.js r=pbro
authorJulian Descottes <jdescottes@mozilla.com>
Mon, 13 May 2019 09:49:24 +0000
changeset 532406 87e01787d465cfcb89c0e593685c15d43a30f61e
parent 532405 7bb36c2fe72cbc073b1fdd64da8bc15ec5ec8d87
child 532407 481580bf3fe866774c10b37850c21990096c53e2
push id11268
push usercsabou@mozilla.com
push dateTue, 14 May 2019 15:24:22 +0000
treeherdermozilla-beta@5fb7fcd568d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1551167
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1551167 - Move import of mochitest/helpers/context.js to test instead of head.js r=pbro Importing scripts in shared head files is hard to maintain because it forces all browser ini that use the shared file to whitelist all its imports. The debugger context helper is almost unused in the inspector, so it would be easier to just import it in the few tests that require it. Also removed the whitelist entry in rules' browser.ini, no test in this suite used it. Differential Revision: https://phabricator.services.mozilla.com/D30882
devtools/client/inspector/rules/test/browser.ini
devtools/client/inspector/test/browser_inspector_highlighter-07.js
devtools/client/inspector/test/head.js
--- a/devtools/client/inspector/rules/test/browser.ini
+++ b/devtools/client/inspector/rules/test/browser.ini
@@ -36,17 +36,16 @@ support-files =
   doc_style_editor_link.css
   doc_test_image.png
   doc_urls_clickable.css
   doc_urls_clickable.html
   doc_variables_1.html
   doc_variables_2.html
   doc_variables_3.html
   head.js
-  !/devtools/client/debugger/test/mochitest/helpers/context.js
   !/devtools/client/inspector/test/head.js
   !/devtools/client/inspector/test/shared-head.js
   !/devtools/client/shared/test/shared-head.js
   !/devtools/client/shared/test/telemetry-test-helpers.js
   !/devtools/client/shared/test/test-actor.js
   !/devtools/client/shared/test/test-actor-registry.js
 
 [browser_rules_add-property-and-reselect.js]
--- a/devtools/client/inspector/test/browser_inspector_highlighter-07.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-07.js
@@ -1,13 +1,18 @@
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 "use strict";
 
+/* import-globals-from ../../debugger/test/mochitest/helpers/context.js */
+Services.scriptloader.loadSubScript(
+  "chrome://mochitests/content/browser/devtools/client/debugger/test/mochitest/helpers/context.js",
+  this);
+
 // Test that the highlighter works when the debugger is paused.
 
 function debuggerIsPaused(dbg) {
   return !!dbg.selectors.getIsPaused(dbg.selectors.getCurrentThread());
 }
 
 function waitForPaused(dbg) {
   return new Promise(resolve => {
--- a/devtools/client/inspector/test/head.js
+++ b/devtools/client/inspector/test/head.js
@@ -17,22 +17,16 @@ Services.scriptloader.loadSubScript(
 //   Services.prefs.clearUserPref("devtools.debugger.log");
 // });
 
 // Import helpers for the inspector that are also shared with others
 Services.scriptloader.loadSubScript(
   "chrome://mochitests/content/browser/devtools/client/inspector/test/shared-head.js",
   this);
 
-// Import helpers for the new debugger
-/* import-globals-from ../../debugger/test/mochitest/helpers/context.js */
-Services.scriptloader.loadSubScript(
-  "chrome://mochitests/content/browser/devtools/client/debugger/test/mochitest/helpers/context.js",
-  this);
-
 const {LocalizationHelper} = require("devtools/shared/l10n");
 const INSPECTOR_L10N =
       new LocalizationHelper("devtools/client/locales/inspector.properties");
 
 registerCleanupFunction(() => {
   Services.prefs.clearUserPref("devtools.inspector.activeSidebar");
 });