Bug 1500383 - Rename test helpers to enable stronger linting;r=daisuke,Ola
authorJulian Descottes <jdescottes@mozilla.com>
Tue, 08 Jan 2019 08:21:21 +0000
changeset 509970 edc7a186c29a996aa3114870b73beac5fe6e9e31
parent 509969 036561e3891d94fc2f179907bf26c26ee02b2931
child 509971 fa39056b910def6214151c1b369861b4ec29f8ec
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaisuke, Ola
bugs1500383
milestone66.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 1500383 - Rename test helpers to enable stronger linting;r=daisuke,Ola Using head-*.js as the name of a test helper makes it automagically visible from all tests in the suite thanks to the import-headjs-globals.js plugin. Renaming them to helper-*.js forces to explicitly import them and get linting errors if we forgot to do so. All helpers have been consistently renamed to helper-*.js. One method from the collapsibilities helper has been moved to the main head.js, because it doesn't have any relation with collapsing target panes. All ADB tests also now check that ADB is not running before starting. I tried forcing ADB to stop in this case, but we can't kill it from the tests apparently, so the only option is for the user to manually kill the process. At least now we get a somewhat helpful error message, and no timeout. Differential Revision: https://phabricator.services.mozilla.com/D15465
devtools/client/aboutdebugging-new/test/browser/browser.ini
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_addons_manifest_url.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_addons_remote_runtime.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_connect_toggle_usb_devices.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_connection_prompt_setting.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_interaction.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_preference.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_debug-target-pane_empty.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_debug-target-pane_usb_runtime.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtools.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_navigate.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_persist_connection.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_routes.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_runtime_connection-prompt.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_runtime_usbclient_closed.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_select_network_runtime.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_serviceworker_push.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_serviceworker_pushservice_url.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_runtime.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_runtime_connect.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_runtime_refresh.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_runtime_select.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_status.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_unknown_runtime.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_stop_adb.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_system_addons.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_temporary_addon_install_error.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_thisfirefox_runtime_info.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_thisfirefox_worker_inspection.js
devtools/client/aboutdebugging-new/test/browser/debug-target-pane_collapsibilities_head.js
devtools/client/aboutdebugging-new/test/browser/head-addons-script.js
devtools/client/aboutdebugging-new/test/browser/head-mocks.js
devtools/client/aboutdebugging-new/test/browser/head-serviceworker.js
devtools/client/aboutdebugging-new/test/browser/head.js
devtools/client/aboutdebugging-new/test/browser/helper-adb.js
devtools/client/aboutdebugging-new/test/browser/helper-addons.js
devtools/client/aboutdebugging-new/test/browser/helper-collapsibilities.js
devtools/client/aboutdebugging-new/test/browser/helper-mocks.js
devtools/client/aboutdebugging-new/test/browser/helper-serviceworker.js
devtools/client/aboutdebugging-new/test/browser/mocks/head-client-wrapper-mock.js
devtools/client/aboutdebugging-new/test/browser/mocks/head-runtime-client-factory-mock.js
devtools/client/aboutdebugging-new/test/browser/mocks/head-usb-runtimes-mock.js
devtools/client/aboutdebugging-new/test/browser/mocks/helper-client-wrapper-mock.js
devtools/client/aboutdebugging-new/test/browser/mocks/helper-runtime-client-factory-mock.js
devtools/client/aboutdebugging-new/test/browser/mocks/helper-usb-runtimes-mock.js
devtools/client/aboutdebugging-new/test/browser/resources/service-workers/push-sw.html
--- a/devtools/client/aboutdebugging-new/test/browser/browser.ini
+++ b/devtools/client/aboutdebugging-new/test/browser/browser.ini
@@ -1,21 +1,22 @@
 [DEFAULT]
 tags = devtools
 subsuite = devtools
 prefs =
   # showSystemAddons has different values depending on the build flags,
   # ensure consistent test behavior by always setting this to false.
   devtools.aboutdebugging.showSystemAddons=false
 support-files =
-  debug-target-pane_collapsibilities_head.js
-  head-addons-script.js
-  head-mocks.js
-  head-serviceworker.js
   head.js
+  helper-adb.js
+  helper-addons.js
+  helper-collapsibilities.js
+  helper-mocks.js
+  helper-serviceworker.js
   mocks/*
   resources/bad-extension/*
   resources/service-workers/*
   resources/test-adb-extension/*
   resources/test-temporary-extension/*
   test-tab-favicons.html
   !/devtools/client/shared/test/shared-head.js
   !/devtools/client/shared/test/shared-redux-head.js
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_addons_manifest_url.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_addons_manifest_url.js
@@ -1,27 +1,26 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-/* import-globals-from head-addons-script.js */
-
 "use strict";
 
 const { adbAddon } = require("devtools/shared/adb/adb-addon");
 
 const ABD_ADDON_NAME = "ADB binary provider";
 
-// Load addons helpers
-Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "head-addons-script.js", this);
+/* import-globals-from helper-adb.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-adb.js", this);
 
 // Test that manifest URLs for addon targets show the manifest correctly in a new tab.
 // This test reuses the ADB extension to be sure to have a valid manifest URL to open.
 add_task(async function() {
   await pushPref("devtools.remote.adb.extensionURL",
                  CHROME_URL_ROOT + "resources/test-adb-extension/adb-extension-#OS#.xpi");
+  await checkAdbNotRunning();
 
   const { document, tab, window } = await openAboutDebugging();
   const usbStatusElement = document.querySelector(".js-sidebar-usb-status");
 
   info("Install ADB");
   adbAddon.install("internal");
   await waitUntil(() => usbStatusElement.textContent.includes("USB devices enabled"));
   await waitForAdbStart();
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_addons_remote_runtime.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_addons_remote_runtime.js
@@ -4,18 +4,18 @@
 "use strict";
 
 const NETWORK_RUNTIME_HOST = "localhost:6080";
 const NETWORK_RUNTIME_APP_NAME = "TestNetworkApp";
 const USB_RUNTIME_ID = "test-runtime-id";
 const USB_RUNTIME_DEVICE_NAME = "test device name";
 const USB_RUNTIME_APP_NAME = "TestUsbApp";
 
-/* import-globals-from head-mocks.js */
-Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "head-mocks.js", this);
+/* import-globals-from helper-mocks.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-mocks.js", this);
 
 // Test that addons are displayed and updated for USB runtimes when expected.
 add_task(async function() {
   const mocks = new Mocks();
 
   const { document, tab } = await openAboutDebugging();
 
   info("Prepare USB client mock");
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_connect_toggle_usb_devices.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_connect_toggle_usb_devices.js
@@ -1,21 +1,25 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+/* import-globals-from helper-adb.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-adb.js", this);
+
 const { AddonManager } = require("resource://gre/modules/AddonManager.jsm");
 
 /**
  * Check that USB Devices scanning can be enabled and disabled from the connect page.
  */
 add_task(async function() {
   await pushPref("devtools.remote.adb.extensionURL",
                  CHROME_URL_ROOT + "resources/test-adb-extension/adb-extension-#OS#.xpi");
+  await checkAdbNotRunning();
 
   const { document, tab } = await openAboutDebugging();
 
   await selectConnectPage(document);
 
   info("Wait until Connect page is displayed");
   await waitUntil(() => document.querySelector(".js-connect-page"));
 
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_connection_prompt_setting.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_connection_prompt_setting.js
@@ -1,16 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-/* import-globals-from head-mocks.js */
-Services.scriptloader.loadSubScript(
-  CHROME_URL_ROOT + "head-mocks.js", this);
+/* import-globals-from helper-mocks.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-mocks.js", this);
 
 /**
  * Check whether can toggle enable/disable connection prompt setting.
  */
 add_task(async function() {
   // enable USB devices mocks
   const mocks = new Mocks();
   const runtime = mocks.createUSBRuntime("1337id", {
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_interaction.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_interaction.js
@@ -1,13 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-collapsibilities.js", this);
+
 /**
  * Test that collapsibilities of DebugTargetPane on RuntimePage by mouse clicking.
  */
 
 add_task(async function() {
   prepareCollapsibilitiesTest();
 
   const { document, tab } = await openAboutDebugging();
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_preference.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_preference.js
@@ -1,13 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-collapsibilities.js", this);
+
 /**
  * Test for preference of DebugTargetPane collapsibilities.
  */
 
 add_task(async function() {
   prepareCollapsibilitiesTest();
 
   const { document, tab } = await openAboutDebugging();
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_debug-target-pane_empty.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_debug-target-pane_empty.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-/* import-globals-from head-addons-script.js */
-
 "use strict";
 
-// Load addons helpers
-Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "head-addons-script.js", this);
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-collapsibilities.js", this);
 
 /**
  * Test that an "empty" message is displayed when there are no debug targets in a debug
  * target pane.
  */
 
 const EXTENSION_PATH = "resources/test-temporary-extension/manifest.json";
 const EXTENSION_NAME = "test-temporary-extension";
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_debug-target-pane_usb_runtime.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_debug-target-pane_usb_runtime.js
@@ -1,20 +1,22 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-collapsibilities.js", this);
+/* import-globals-from helper-mocks.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-mocks.js", this);
+
 const RUNTIME_ID = "test-runtime-id";
 const RUNTIME_DEVICE_NAME = "test device name";
 const RUNTIME_APP_NAME = "TestApp";
 
-/* import-globals-from head-mocks.js */
-Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "head-mocks.js", this);
-
 // Test that the expected supported categories are displayed for USB runtimes.
 add_task(async function() {
   const mocks = new Mocks();
 
   const { document, tab } = await openAboutDebugging();
 
   mocks.createUSBRuntime(RUNTIME_ID, {
     deviceName: RUNTIME_DEVICE_NAME,
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtools.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtools.js
@@ -1,13 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-collapsibilities.js", this);
+
 /**
  * Check that DevTools are not closed when leaving This Firefox runtime page.
  */
 
 add_task(async function() {
   info("Force all debug target panes to be expanded");
   prepareCollapsibilitiesTest();
 
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_navigate.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_navigate.js
@@ -1,13 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-collapsibilities.js", this);
+
 /**
  * Check that navigating from This Firefox to Connect and back to This Firefox works and
  * does not leak.
  */
 
 const TAB_URL_1 = "data:text/html,<title>TAB1</title>";
 const TAB_URL_2 = "data:text/html,<title>TAB2</title>";
 
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_persist_connection.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_persist_connection.js
@@ -4,18 +4,18 @@
 "use strict";
 
 const NETWORK_RUNTIME_HOST = "localhost:6080";
 const NETWORK_RUNTIME_APP_NAME = "TestNetworkApp";
 const USB_RUNTIME_ID = "test-runtime-id";
 const USB_DEVICE_NAME = "test device name";
 const USB_APP_NAME = "TestApp";
 
-/* import-globals-from head-mocks.js */
-Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "head-mocks.js", this);
+/* import-globals-from helper-mocks.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-mocks.js", this);
 
 // Test that remote runtime connections are persisted across about:debugging reloads.
 add_task(async function() {
   const mocks = new Mocks();
 
   info("Test with a USB runtime");
   const usbClient = mocks.createUSBRuntime(USB_RUNTIME_ID, {
     name: USB_APP_NAME,
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_routes.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_routes.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-/* import-globals-from head-mocks.js */
-Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "head-mocks.js", this);
+/* import-globals-from helper-mocks.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-mocks.js", this);
 
 /**
  * Test that the initial route is /runtime/this-firefox
  */
 add_task(async function() {
   info("Check root route redirects to 'This Firefox'");
   const { document, tab } = await openAboutDebugging();
   is(document.location.hash, "#/runtime/this-firefox");
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_runtime_connection-prompt.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_runtime_connection-prompt.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-/* import-globals-from head-mocks.js */
+/* import-globals-from helper-mocks.js */
 Services.scriptloader.loadSubScript(
-  CHROME_URL_ROOT + "head-mocks.js", this);
+  CHROME_URL_ROOT + "helper-mocks.js", this);
 
 /**
  * Test that remote runtimes show the connection prompt,
  * but it's hidden in 'This Firefox'
  */
 add_task(async function() {
   // enable USB devices mocks
   const mocks = new Mocks();
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_runtime_usbclient_closed.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_runtime_usbclient_closed.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-/* import-globals-from head-mocks.js */
-Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "head-mocks.js", this);
+/* import-globals-from helper-mocks.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-mocks.js", this);
 
 const RUNTIME_DEVICE_ID = "1234";
 const RUNTIME_DEVICE_NAME = "A device";
 const RUNTIME_NAME = "Test application";
 
 // Test that about:debugging navigates back to the default page when the server for the
 // current USB runtime is closed.
 add_task(async function() {
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_select_network_runtime.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_select_network_runtime.js
@@ -1,21 +1,21 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+/* import-globals-from helper-mocks.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-mocks.js", this);
+
 const NETWORK_RUNTIME_HOST = "localhost:6080";
 const NETWORK_RUNTIME_APP_NAME = "TestNetworkApp";
 const NETWORK_RUNTIME_CHANNEL = "SomeChannel";
 const NETWORK_RUNTIME_VERSION = "12.3";
 
-/* import-globals-from head-mocks.js */
-Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "head-mocks.js", this);
-
 // Test that network runtimes can be selected.
 add_task(async function() {
   const mocks = new Mocks();
 
   const { document, tab } = await openAboutDebugging();
 
   info("Prepare Network client mock");
   const networkClient = mocks.createNetworkRuntime(NETWORK_RUNTIME_HOST, {
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_serviceworker_push.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_serviceworker_push.js
@@ -1,17 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-/* global sendAsyncMessage */
-
 "use strict";
 
-/* import-globals-from head-serviceworker.js */
-Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "head-serviceworker.js", this);
+/* import-globals-from helper-serviceworker.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-serviceworker.js", this);
 
 const SERVICE_WORKER = URL_ROOT + "resources/service-workers/push-sw.js";
 const TAB_URL = URL_ROOT + "resources/service-workers/push-sw.html";
 
 // Test that clicking on the Push button next to a Service Worker works as intended.
 // It should trigger a "push" notification in the worker.
 add_task(async function() {
   await enableServiceWorkerDebugging();
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_serviceworker_pushservice_url.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_serviceworker_pushservice_url.js
@@ -1,17 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-/* global sendAsyncMessage */
-
 "use strict";
 
-/* import-globals-from head-serviceworker.js */
-Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "head-serviceworker.js", this);
+/* import-globals-from helper-serviceworker.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-serviceworker.js", this);
 
 const SERVICE_WORKER = URL_ROOT + "resources/service-workers/push-sw.js";
 const TAB_URL = URL_ROOT + "resources/service-workers/push-sw.html";
 
 const FAKE_ENDPOINT = "https://fake/endpoint";
 
 // Test that the push service url is displayed for service workers subscribed to a push
 // service.
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_runtime.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_runtime.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-/* import-globals-from head-mocks.js */
-Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "head-mocks.js", this);
+/* import-globals-from helper-mocks.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-mocks.js", this);
 
 // Test that USB runtimes appear and disappear from the sidebar.
 add_task(async function() {
   const mocks = new Mocks();
 
   const { document, tab } = await openAboutDebugging();
 
   mocks.createUSBRuntime("test_device_id", {
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_runtime_connect.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_runtime_connect.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-/* import-globals-from head-mocks.js */
-Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "head-mocks.js", this);
+/* import-globals-from helper-mocks.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-mocks.js", this);
 
 const RUNTIME_ID = "test-runtime-id";
 const RUNTIME_DEVICE_NAME = "test device name";
 
 // Test that USB runtimes appear and disappear from the sidebar,
 // as well as their connect button.
 add_task(async function() {
   const mocks = new Mocks();
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_runtime_refresh.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_runtime_refresh.js
@@ -1,23 +1,23 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+/* import-globals-from helper-mocks.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-mocks.js", this);
+
 const RUNTIME_ID = "test-runtime-id";
 const RUNTIME_DEVICE_NAME = "test device name";
 const RUNTIME_APP_NAME = "TestApp";
 
 const OTHER_RUNTIME_ID = "other-runtime-id";
 const OTHER_RUNTIME_APP_NAME = "OtherApp";
 
-/* import-globals-from head-mocks.js */
-Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "head-mocks.js", this);
-
 // Test that USB runtimes are ot disconnected on refresh.
 add_task(async function() {
   const mocks = new Mocks();
 
   const { document, tab } = await openAboutDebugging();
 
   info("Create a first runtime and connect to it");
   mocks.createUSBRuntime(RUNTIME_ID, {
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_runtime_select.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_runtime_select.js
@@ -1,19 +1,19 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+/* import-globals-from helper-mocks.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-mocks.js", this);
+
 const RUNTIME_DEVICE_ID = "1234";
 const RUNTIME_DEVICE_NAME = "A device";
 
-/* import-globals-from head-mocks.js */
-Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "head-mocks.js", this);
-
 // Test that we can select a runtime in the sidebar
 add_task(async function() {
   const mocks = new Mocks();
 
   const { document, tab } = await openAboutDebugging();
 
   mocks.createUSBRuntime(RUNTIME_DEVICE_ID, { deviceName: RUNTIME_DEVICE_NAME });
   mocks.emitUSBUpdate();
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_status.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_status.js
@@ -1,22 +1,26 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+/* import-globals-from helper-adb.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-adb.js", this);
+
 const { adbAddon } = require("devtools/shared/adb/adb-addon");
 
 /**
  * This test asserts that the sidebar shows a message describing the status of the USB
  * devices scanning.
  */
 add_task(async function() {
   await pushPref("devtools.remote.adb.extensionURL",
                  CHROME_URL_ROOT + "resources/test-adb-extension/adb-extension-#OS#.xpi");
+  await checkAdbNotRunning();
 
   const { document, tab } = await openAboutDebugging();
 
   const usbStatusElement = document.querySelector(".js-sidebar-usb-status");
   ok(usbStatusElement, "Sidebar shows the USB status element");
   ok(usbStatusElement.textContent.includes("USB devices disabled"),
     "USB status element has the expected content");
 
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_unknown_runtime.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_unknown_runtime.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-/* import-globals-from head-mocks.js */
-Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "head-mocks.js", this);
+/* import-globals-from helper-mocks.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-mocks.js", this);
 
 const RUNTIME_NAME = "Firefox 123";
 
 // Test that unknown runtimes:
 // - are displayed without a connect button.
 // - cannot be selected
 // - display a specific text ("Waiting for runtime") instead of the runtime name
 add_task(async function() {
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_stop_adb.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_stop_adb.js
@@ -1,32 +1,28 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+/* import-globals-from helper-adb.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-adb.js", this);
+
 const { adbAddon } = require("devtools/shared/adb/adb-addon");
 const { check } = require("devtools/shared/adb/adb-running-checker");
 
 /**
  * Check that ADB is stopped:
  * - when the adb extension is uninstalled
  * - when no consumer is registered
  */
 add_task(async function() {
   await pushPref("devtools.remote.adb.extensionURL",
                  CHROME_URL_ROOT + "resources/test-adb-extension/adb-extension-#OS#.xpi");
-
-  info("Check if ADB is already running before the test starts");
-  const isAdbAlreadyRunning = await check();
-  if (isAdbAlreadyRunning) {
-    ok(false, "The ADB process is already running on this machine, it should be " +
-      "stopped before running this test");
-    return;
-  }
+  await checkAdbNotRunning();
 
   const { tab } = await openAboutDebugging();
 
   info("Install the adb extension and wait for ADB to start");
   // Use "internal" as the install source to avoid triggering telemetry.
   adbAddon.install("internal");
   await waitForAdbStart();
 
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_system_addons.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_system_addons.js
@@ -1,19 +1,19 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-/* import-globals-from mocks/head-client-wrapper-mock.js */
+/* import-globals-from mocks/helper-client-wrapper-mock.js */
 Services.scriptloader.loadSubScript(
-  CHROME_URL_ROOT + "mocks/head-client-wrapper-mock.js", this);
-/* import-globals-from mocks/head-runtime-client-factory-mock.js */
+  CHROME_URL_ROOT + "mocks/helper-client-wrapper-mock.js", this);
+/* import-globals-from mocks/helper-runtime-client-factory-mock.js */
 Services.scriptloader.loadSubScript(
-  CHROME_URL_ROOT + "mocks/head-runtime-client-factory-mock.js", this);
+  CHROME_URL_ROOT + "mocks/helper-runtime-client-factory-mock.js", this);
 
 // Test that system addons are only displayed when the showSystemAddons preference is
 // true.
 
 const SYSTEM_ADDON =
   createAddonData({ id: "system", name: "System Addon", isSystem: true });
 const INSTALLED_ADDON =
   createAddonData({ id: "installed", name: "Installed Addon", isSystem: false });
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_temporary_addon_install_error.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_temporary_addon_install_error.js
@@ -1,17 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-/* import-globals-from head-addons-script.js */
-
 "use strict";
 
-// Load addons helpers
-Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "head-addons-script.js", this);
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
 
 /**
  * Test that the installation error messages are displayed when installing temporary
  * extensions.
  */
 
 const BAD_EXTENSION_PATH = "resources/bad-extension/manifest.json";
 const EXTENSION_PATH = "resources/test-temporary-extension/manifest.json";
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_thisfirefox_runtime_info.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_thisfirefox_runtime_info.js
@@ -1,19 +1,19 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-/* import-globals-from mocks/head-client-wrapper-mock.js */
+/* import-globals-from mocks/helper-client-wrapper-mock.js */
 Services.scriptloader.loadSubScript(
-  CHROME_URL_ROOT + "mocks/head-client-wrapper-mock.js", this);
-/* import-globals-from mocks/head-runtime-client-factory-mock.js */
+  CHROME_URL_ROOT + "mocks/helper-client-wrapper-mock.js", this);
+/* import-globals-from mocks/helper-runtime-client-factory-mock.js */
 Services.scriptloader.loadSubScript(
-  CHROME_URL_ROOT + "mocks/head-runtime-client-factory-mock.js", this);
+  CHROME_URL_ROOT + "mocks/helper-runtime-client-factory-mock.js", this);
 
 /**
  * Check that the runtime info is correctly displayed for ThisFirefox.
  * Also acts as basic sanity check for the default mock of the this-firefox client.
  */
 
 add_task(async function() {
   // Setup a mock for our runtime client factory to return the default THIS_FIREFOX client
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_thisfirefox_worker_inspection.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_thisfirefox_worker_inspection.js
@@ -1,19 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-/* import-globals-from mocks/head-client-wrapper-mock.js */
+/* import-globals-from mocks/helper-client-wrapper-mock.js */
 Services.scriptloader.loadSubScript(
-  CHROME_URL_ROOT + "mocks/head-client-wrapper-mock.js", this);
-/* import-globals-from mocks/head-runtime-client-factory-mock.js */
+  CHROME_URL_ROOT + "mocks/helper-client-wrapper-mock.js", this);
+/* import-globals-from mocks/helper-runtime-client-factory-mock.js */
 Services.scriptloader.loadSubScript(
-  CHROME_URL_ROOT + "mocks/head-runtime-client-factory-mock.js", this);
+  CHROME_URL_ROOT + "mocks/helper-runtime-client-factory-mock.js", this);
+
 const { gDevToolsBrowser } = require("devtools/client/framework/devtools-browser");
 
 add_task(async function() {
   const thisFirefoxClient = createThisFirefoxClientMock();
   // Prepare a worker mock.
   const testWorkerTargetFront = {
     actorID: "test-worker-id",
   };
--- a/devtools/client/aboutdebugging-new/test/browser/head.js
+++ b/devtools/client/aboutdebugging-new/test/browser/head.js
@@ -1,32 +1,27 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 /* eslint-env browser */
 /* eslint no-unused-vars: [2, {"vars": "local"}] */
 /* import-globals-from ../../../shared/test/shared-head.js */
-/* import-globals-from debug-target-pane_collapsibilities_head.js */
-
-"use strict";
 
 // Load the shared-head file first.
 Services.scriptloader.loadSubScript(
   "chrome://mochitests/content/browser/devtools/client/shared/test/shared-head.js",
   this);
 
 // Load the shared Redux helpers into this compartment.
 Services.scriptloader.loadSubScript(
   "chrome://mochitests/content/browser/devtools/client/shared/test/shared-redux-head.js",
   this);
 
-// Load collapsibilities helpers
-Services.scriptloader.loadSubScript(
-  CHROME_URL_ROOT + "debug-target-pane_collapsibilities_head.js", this);
-
 // Make sure the ADB addon is removed and ADB is stopped when the test ends.
 registerCleanupFunction(async function() {
   try {
     const { adbAddon } = require("devtools/shared/adb/adb-addon");
     await adbAddon.uninstall();
   } catch (e) {
     // Will throw if the addon is already uninstalled, ignore exceptions here.
   }
@@ -148,16 +143,34 @@ async function selectConnectPage(doc) {
 
   info("Click on the Connect link in the sidebar");
   connectLink.click();
 
   info("Wait until Connect page is displayed");
   await waitUntil(() => doc.querySelector(".js-connect-page"));
 }
 
+function getDebugTargetPane(title, document) {
+  // removes the suffix "(<NUMBER>)" in debug target pane's title, if needed
+  const sanitizeTitle = (x) => {
+    return x.replace(/\s+\(\d+\)$/, "");
+  };
+
+  const targetTitle = sanitizeTitle(title);
+  for (const titleEl of document.querySelectorAll(".js-debug-target-pane-title")) {
+    if (sanitizeTitle(titleEl.textContent) !== targetTitle) {
+      continue;
+    }
+
+    return titleEl.closest(".js-debug-target-pane");
+  }
+
+  return null;
+}
+
 function findDebugTargetByText(text, document) {
   const targets = [...document.querySelectorAll(".js-debug-target-item")];
   return targets.find(target => target.textContent.includes(text));
 }
 
 function findSidebarItemByText(text, document) {
   const sidebarItems = document.querySelectorAll(".js-sidebar-item");
   return [...sidebarItems].find(element => {
@@ -188,32 +201,8 @@ async function selectRuntime(deviceName,
   const sidebarItem = findSidebarItemByText(deviceName, document);
   sidebarItem.querySelector(".js-sidebar-link").click();
 
   await waitUntil(() => {
     const runtimeInfo = document.querySelector(".js-runtime-info");
     return runtimeInfo && runtimeInfo.textContent.includes(name);
   });
 }
-
-// Returns a promise that resolves when the adb process exists and is running.
-async function waitForAdbStart() {
-  info("Wait for ADB to start");
-  const { adbProcess } = require("devtools/shared/adb/adb-process");
-  const { check } = require("devtools/shared/adb/adb-running-checker");
-  return asyncWaitUntil(async () => {
-    const isProcessReady = adbProcess.ready;
-    const isRunning = await check();
-    return isProcessReady && isRunning;
-  });
-}
-
-// Returns a promise that resolves when the adb process is no longer running.
-async function waitForAdbStop() {
-  info("Wait for ADB to stop");
-  const { adbProcess } = require("devtools/shared/adb/adb-process");
-  const { check } = require("devtools/shared/adb/adb-running-checker");
-  return asyncWaitUntil(async () => {
-    const isProcessReady = adbProcess.ready;
-    const isRunning = await check();
-    return !isProcessReady && !isRunning;
-  });
-}
new file mode 100644
--- /dev/null
+++ b/devtools/client/aboutdebugging-new/test/browser/helper-adb.js
@@ -0,0 +1,43 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from head.js */
+
+async function checkAdbNotRunning() {
+  info("Check if ADB is already running before the test starts");
+  const { check } = require("devtools/shared/adb/adb-running-checker");
+  const isAdbAlreadyRunning = await check();
+  if (isAdbAlreadyRunning) {
+    throw new Error("The ADB process is already running on this machine, it should be " +
+      "stopped before running this test");
+  }
+}
+/* exported checkAdbNotRunning */
+
+// Returns a promise that resolves when the adb process exists and is running.
+async function waitForAdbStart() {
+  info("Wait for ADB to start");
+  const { adbProcess } = require("devtools/shared/adb/adb-process");
+  const { check } = require("devtools/shared/adb/adb-running-checker");
+  return asyncWaitUntil(async () => {
+    const isProcessReady = adbProcess.ready;
+    const isRunning = await check();
+    return isProcessReady && isRunning;
+  });
+}
+/* exported waitForAdbStart */
+
+// Returns a promise that resolves when the adb process is no longer running.
+async function waitForAdbStop() {
+  info("Wait for ADB to stop");
+  const { adbProcess } = require("devtools/shared/adb/adb-process");
+  const { check } = require("devtools/shared/adb/adb-running-checker");
+  return asyncWaitUntil(async () => {
+    const isProcessReady = adbProcess.ready;
+    const isRunning = await check();
+    return !isProcessReady && !isRunning;
+  });
+}
+/* exported waitForAdbStop */
rename from devtools/client/aboutdebugging-new/test/browser/head-addons-script.js
rename to devtools/client/aboutdebugging-new/test/browser/helper-addons.js
--- a/devtools/client/aboutdebugging-new/test/browser/head-addons-script.js
+++ b/devtools/client/aboutdebugging-new/test/browser/helper-addons.js
@@ -1,30 +1,29 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
-/* import-globals-from ../../../shared/test/shared-head.js */
-/* import-globals-from head.js */
 
 "use strict";
 
+/* import-globals-from head.js */
+
 const { Management } = ChromeUtils.import("resource://gre/modules/Extension.jsm", {});
 
-function getSupportsFile(path) {
+function _getSupportsFile(path) {
   const cr = Cc["@mozilla.org/chrome/chrome-registry;1"]
     .getService(Ci.nsIChromeRegistry);
   const uri = Services.io.newURI(CHROME_URL_ROOT + path);
   const fileurl = cr.convertChromeURL(uri);
   return fileurl.QueryInterface(Ci.nsIFileURL);
 }
 
 /**
  * Install a temporary extension at the provided path, with the provided name.
  * Will use a mock file picker to select the file.
  */
-// eslint-disable-next-line no-unused-vars
 async function installTemporaryExtension(path, name, document) {
   // Mock the file picker to select a test addon
   prepareMockFilePicker(path);
 
   const onAddonInstalled = new Promise(done => {
     Management.on("startup", function listener(event, extension) {
       if (extension.name != name) {
         return;
@@ -36,24 +35,27 @@ async function installTemporaryExtension
   });
 
   // Trigger the file picker by clicking on the button
   document.querySelector(".js-temporary-extension-install-button").click();
 
   info("Wait for addon to be installed");
   await onAddonInstalled;
 }
+/* exported installTemporaryExtension */
 
 async function removeTemporaryExtension(name, document) {
   info(`Remove the temporary extension with name: '${name}'`);
   const temporaryExtensionItem = findDebugTargetByText(name, document);
   temporaryExtensionItem.querySelector(".js-temporary-extension-remove-button").click();
 
   info("Wait until the debug target item disappears");
   await waitUntil(() => !findDebugTargetByText(name, document));
 }
+/* exported removeTemporaryExtension */
 
 function prepareMockFilePicker(path) {
   // Mock the file picker to select a test addon
   const MockFilePicker = SpecialPowers.MockFilePicker;
   MockFilePicker.init(window);
-  MockFilePicker.setFiles([getSupportsFile(path).file]);
+  MockFilePicker.setFiles([_getSupportsFile(path).file]);
 }
+/* exported prepareMockFilePicker */
rename from devtools/client/aboutdebugging-new/test/browser/debug-target-pane_collapsibilities_head.js
rename to devtools/client/aboutdebugging-new/test/browser/helper-collapsibilities.js
--- a/devtools/client/aboutdebugging-new/test/browser/debug-target-pane_collapsibilities_head.js
+++ b/devtools/client/aboutdebugging-new/test/browser/helper-collapsibilities.js
@@ -1,14 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-// eslint-disable-next-line no-unused-vars
 const TARGET_PANES = [
   {
     title: "Temporary Extensions",
     pref: "devtools.aboutdebugging.collapsibilities.temporaryExtension",
   },
   {
     title: "Extensions",
     pref: "devtools.aboutdebugging.collapsibilities.installedExtension",
@@ -25,49 +24,31 @@ const TARGET_PANES = [
     title: "Shared Workers",
     pref: "devtools.aboutdebugging.collapsibilities.sharedWorker",
   },
   {
     title: "Other Workers",
     pref: "devtools.aboutdebugging.collapsibilities.otherWorker",
   },
 ];
-
-// eslint-disable-next-line no-unused-vars
-function getDebugTargetPane(title, document) {
-  // removes the suffix "(<NUMBER>)" in debug target pane's title, if needed
-  const sanitizeTitle = (x) => {
-    return x.replace(/\s+\(\d+\)$/, "");
-  };
+/* exported TARGET_PANES */
 
-  const targetTitle = sanitizeTitle(title);
-  for (const titleEl of document.querySelectorAll(".js-debug-target-pane-title")) {
-    if (sanitizeTitle(titleEl.textContent) !== targetTitle) {
-      continue;
-    }
-
-    return titleEl.closest(".js-debug-target-pane");
-  }
-
-  return null;
-}
-
-// eslint-disable-next-line no-unused-vars
 function prepareCollapsibilitiesTest() {
   // Make all collapsibilities to be expanded.
   for (const { pref } of TARGET_PANES) {
     Services.prefs.setBoolPref(pref, false);
   }
 }
+/* exported prepareCollapsibilitiesTest */
 
-// eslint-disable-next-line no-unused-vars
 async function toggleCollapsibility(debugTargetPane) {
   debugTargetPane.querySelector(".js-debug-target-pane-title").click();
   // Wait for animation of collapse/expand.
   const animations = debugTargetPane.ownerDocument.getAnimations();
   await Promise.all(animations.map(animation => animation.finished));
 }
+/* exported toggleCollapsibility */
 
 registerCleanupFunction(() => {
   for (const { pref } of TARGET_PANES) {
     Services.prefs.clearUserPref(pref);
   }
 });
rename from devtools/client/aboutdebugging-new/test/browser/head-mocks.js
rename to devtools/client/aboutdebugging-new/test/browser/helper-mocks.js
--- a/devtools/client/aboutdebugging-new/test/browser/head-mocks.js
+++ b/devtools/client/aboutdebugging-new/test/browser/helper-mocks.js
@@ -1,25 +1,26 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+/* import-globals-from ../../../shared/test/shared-head.js */
+
 const MOCKS_ROOT = CHROME_URL_ROOT + "mocks/";
+/* import-globals-from mocks/helper-client-wrapper-mock.js */
+Services.scriptloader.loadSubScript(MOCKS_ROOT + "helper-client-wrapper-mock.js", this);
+/* import-globals-from mocks/helper-runtime-client-factory-mock.js */
+Services.scriptloader.loadSubScript(MOCKS_ROOT + "helper-runtime-client-factory-mock.js",
+  this);
+/* import-globals-from mocks/helper-usb-runtimes-mock.js */
+Services.scriptloader.loadSubScript(MOCKS_ROOT + "helper-usb-runtimes-mock.js", this);
 
 const { RUNTIMES } = require("devtools/client/aboutdebugging-new/src/constants");
 
-/* import-globals-from mocks/head-client-wrapper-mock.js */
-Services.scriptloader.loadSubScript(MOCKS_ROOT + "head-client-wrapper-mock.js", this);
-/* import-globals-from mocks/head-runtime-client-factory-mock.js */
-Services.scriptloader.loadSubScript(MOCKS_ROOT + "head-runtime-client-factory-mock.js",
-  this);
-/* import-globals-from mocks/head-usb-runtimes-mock.js */
-Services.scriptloader.loadSubScript(MOCKS_ROOT + "head-usb-runtimes-mock.js", this);
-
 /**
  * This wrapper around the mocks used in about:debugging tests provides helpers to
  * quickly setup mocks for runtime tests involving USB, network or wifi runtimes that can
  * are difficult to setup in a test environment.
  */
 class Mocks {
   constructor() {
     // Setup the usb-runtimes mock to rely on the internal _usbRuntimes array.
@@ -155,8 +156,10 @@ class Mocks {
   removeRuntime(id) {
     if (this._clients[RUNTIMES.USB][id]) {
       this.removeUSBRuntime(id);
     } else if (this._clients[RUNTIMES.NETWORK][id]) {
       this.removeNetworkRuntime(id);
     }
   }
 }
+/* exported Mocks */
+
rename from devtools/client/aboutdebugging-new/test/browser/head-serviceworker.js
rename to devtools/client/aboutdebugging-new/test/browser/helper-serviceworker.js
--- a/devtools/client/aboutdebugging-new/test/browser/head-serviceworker.js
+++ b/devtools/client/aboutdebugging-new/test/browser/helper-serviceworker.js
@@ -1,29 +1,30 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
-/* import-globals-from ../../../shared/test/shared-head.js */
-/* import-globals-from head.js */
 
 "use strict";
 
+/* import-globals-from head.js */
+
 /**
  * Temporarily flip all the preferences necessary for service worker testing.
  */
 async function enableServiceWorkerDebugging() {
   // Enable service workers.
   await pushPref("dom.serviceWorkers.enabled", true);
 
   // Accept workers from mochitest's http (normally only available in https).
   await pushPref("dom.serviceWorkers.testing.enabled", true);
 
   // Force single content process. Necessary until sw e10s refactor is done (Bug 1231208).
   await pushPref("dom.ipc.processCount", 1);
   Services.ppmm.releaseCachedProcesses();
 }
+/* exported enableServiceWorkerDebugging */
 
 /**
  * Helper to listen once on a message sent using postMessage from the provided tab.
  *
  * @param {Tab} tab
  *        The tab on which the message will be received.
  * @param {String} message
  *        The name of the expected message.
@@ -32,26 +33,28 @@ function onTabMessage(tab, message) {
   const mm = tab.linkedBrowser.messageManager;
   return new Promise(resolve => {
     mm.addMessageListener(message, function listener() {
       mm.removeMessageListener(message, listener);
       resolve();
     });
   });
 }
+/* exported onTabMessage */
 
 async function waitForServiceWorkerRunning(workerText, document) {
   await waitUntil(() => {
     const target = findDebugTargetByText(workerText, document);
     const status = target && target.querySelector(".js-worker-status");
     return status && status.textContent === "Running";
   });
 
   return findDebugTargetByText(workerText, document);
 }
+/* exported waitForServiceWorkerRunning */
 
 /**
  * Helper to listen once on a message sent using postMessage from the provided tab.
  *
  * @param {Tab} tab
  *        The tab on which the message will be received.
  * @param {String} message
  *        The name of the expected message.
@@ -60,16 +63,17 @@ function forwardServiceWorkerMessage(tab
   info("Make the test page notify us when the service worker sends a message.");
   return ContentTask.spawn(tab.linkedBrowser, {}, function() {
     const win = content.wrappedJSObject;
     win.navigator.serviceWorker.addEventListener("message", function(event) {
       sendAsyncMessage(event.data);
     });
   });
 }
+/* exported forwardServiceWorkerMessage */
 
 /**
  * Unregister the service worker from the content page. The content page should define
  * `getRegistration` to allow this helper to retrieve the service worker registration that
  * should be unregistered.
  *
  * @param {Tab} tab
  *        The tab on which the service worker should be removed.
@@ -77,8 +81,9 @@ function forwardServiceWorkerMessage(tab
 async function unregisterServiceWorker(tab) {
   return ContentTask.spawn(tab.linkedBrowser, {}, function() {
     const win = content.wrappedJSObject;
     // Check that the content page defines getRegistration.
     is(typeof win.getRegistration, "function", "getRegistration is a valid function");
     win.getRegistration().unregister();
   });
 }
+/* exported unregisterServiceWorker */
rename from devtools/client/aboutdebugging-new/test/browser/mocks/head-client-wrapper-mock.js
rename to devtools/client/aboutdebugging-new/test/browser/mocks/helper-client-wrapper-mock.js
--- a/devtools/client/aboutdebugging-new/test/browser/mocks/head-client-wrapper-mock.js
+++ b/devtools/client/aboutdebugging-new/test/browser/mocks/helper-client-wrapper-mock.js
@@ -1,11 +1,10 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
-/* import-globals-from ../../../../shared/test/shared-head.js */
 
 "use strict";
 
 // This head file contains helpers to create mock versions of the ClientWrapper class
 // defined at devtools/client/aboutdebugging-new/src/modules/client-wrapper.js .
 
 const { RUNTIME_PREFERENCE } =
   require("devtools/client/aboutdebugging-new/src/constants");
@@ -101,8 +100,10 @@ function createThisFirefoxClientMock() {
   };
 
   const mockThisFirefoxClient = createClientMock();
   mockThisFirefoxClient.listTabs = () => ([mockAboutDebuggingTab]);
   mockThisFirefoxClient.getDeviceDescription = () => mockThisFirefoxDescription;
 
   return mockThisFirefoxClient;
 }
+/* exported createThisFirefoxClientMock */
+
rename from devtools/client/aboutdebugging-new/test/browser/mocks/head-runtime-client-factory-mock.js
rename to devtools/client/aboutdebugging-new/test/browser/mocks/helper-runtime-client-factory-mock.js
--- a/devtools/client/aboutdebugging-new/test/browser/mocks/head-runtime-client-factory-mock.js
+++ b/devtools/client/aboutdebugging-new/test/browser/mocks/helper-runtime-client-factory-mock.js
@@ -1,40 +1,43 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
-/* import-globals-from ../../../../shared/test/shared-head.js */
+
 "use strict";
 
 /**
  * Setup the loader to return the provided mock object instead of the regular
  * runtime-client-factory module.
  *
  * @param {Object}
  *        mock should implement the following methods:
  *        - createClientForRuntime(runtime)
  */
 function enableRuntimeClientFactoryMock(mock) {
   const { setMockedModule } = require("devtools/client/shared/browser-loader-mocks");
   setMockedModule(mock,
     "devtools/client/aboutdebugging-new/src/modules/runtime-client-factory");
 }
+/* exported enableRuntimeClientFactoryMock */
 
 /**
  * Update the loader to clear the mock entry for the runtime-client-factory module.
  */
 function disableRuntimeClientFactoryMock() {
   const { removeMockedModule } = require("devtools/client/shared/browser-loader-mocks");
   removeMockedModule(
     "devtools/client/aboutdebugging-new/src/modules/runtime-client-factory");
 }
+/* exported disableRuntimeClientFactoryMock */
 
 /**
  * Creates a simple mock version for runtime-client-factory, implementing all the expected
  * methods with empty placeholders.
  */
 function createRuntimeClientFactoryMock() {
   const RuntimeClientFactoryMock = {};
   RuntimeClientFactoryMock.createClientForRuntime = function(runtime) {
     console.log("MOCKED METHOD createClientForRuntime");
   };
 
   return RuntimeClientFactoryMock;
 }
+/* exported createRuntimeClientFactoryMock */
rename from devtools/client/aboutdebugging-new/test/browser/mocks/head-usb-runtimes-mock.js
rename to devtools/client/aboutdebugging-new/test/browser/mocks/helper-usb-runtimes-mock.js
--- a/devtools/client/aboutdebugging-new/test/browser/mocks/head-usb-runtimes-mock.js
+++ b/devtools/client/aboutdebugging-new/test/browser/mocks/helper-usb-runtimes-mock.js
@@ -1,11 +1,10 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
-/* import-globals-from ../../../../shared/test/shared-head.js */
 
 "use strict";
 
 /**
  * Setup the loader to return the provided mock object instead of the regular
  * usb-runtimes module.
  *
  * @param {Object}
@@ -16,25 +15,27 @@
  *        - getUSBRuntimes()
  *        - removeUSBRuntimesObserver(listener)
  */
 function enableUsbRuntimesMock(mock) {
   const { setMockedModule } = require("devtools/client/shared/browser-loader-mocks");
   setMockedModule(mock,
     "devtools/client/aboutdebugging-new/src/modules/usb-runtimes");
 }
+/* exported enableUsbRuntimesMock */
 
 /**
  * Update the loader to clear the mock entry for the usb-runtimes module.
  */
 function disableUsbRuntimesMock() {
   const { removeMockedModule } = require("devtools/client/shared/browser-loader-mocks");
   removeMockedModule(
     "devtools/client/aboutdebugging-new/src/modules/usb-runtimes");
 }
+/* exported disableUsbRuntimesMock */
 
 /**
  * Creates a simple mock version for usb-runtimes, implementing all the expected methods
  * with empty placeholders.
  */
 function createUsbRuntimesMock() {
   const usbRuntimesMock = {};
   usbRuntimesMock.addUSBRuntimesObserver = function(listener) {
@@ -58,16 +59,17 @@ function createUsbRuntimesMock() {
   };
 
   usbRuntimesMock.removeUSBRuntimesObserver = function(listener) {
     console.log("MOCKED METHOD removeUSBRuntimesObserver");
   };
 
   return usbRuntimesMock;
 }
+/* exported createUsbRuntimesMock */
 
 /**
  * The usb-runtimes module allows to observer runtime updates. To simulate this behaviour
  * the easiest is to use an EventEmitter-decorated object that can accept listeners and
  * can emit events from the test.
  *
  * This method will update the addUSBRuntimesObserver method of the provided
  * usbRuntimesMock in order to add listeners to a mockObserver, and returns said observer
@@ -85,8 +87,9 @@ function addObserverMock(usbRuntimesMock
 
   // NOTE FOR REVIEW: Instead of emitting "runtime-list-updated" events in the test,
   // this mock could have a emitObservedEvent method, that would just emit the correct
   // event. This way if the event name changes, everything remains contained in this
   // method.
 
   return observerMock;
 }
+/* exported addObserverMock */
--- a/devtools/client/aboutdebugging-new/test/browser/resources/service-workers/push-sw.html
+++ b/devtools/client/aboutdebugging-new/test/browser/resources/service-workers/push-sw.html
@@ -21,17 +21,17 @@ const registerServiceWorker = async func
   try {
     registration = await navigator.serviceWorker.register("push-sw.js");
     dump("Push service worker registered\n");
   } catch (e) {
     dump("Push service worker not registered: " + e + "\n");
   }
 };
 
-// Helper called from head-serviceworker.js to unregister the service worker.
+// Helper called from helper-serviceworker.js to unregister the service worker.
 window.getRegistration = function() {
   return registration;
 };
 
 // Helper called from browser_aboutdebugging_serviceworker_pushservice_url.js
 window.subscribeToPush = async function() {
   try {
     subscription = await registration.pushManager.subscribe();