Bug 1320790 - Only inject gcli test helper in the inspect that use it. r=pbro draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 28 Nov 2016 06:08:52 -0800
changeset 445862 a044b79821bb81b957aba4251fa51443348661b4
parent 445303 f8107cf961444a8d7fdc2c0f446238af9893f875
child 538657 20af53c8c311b3fd5160424e594b1e4339a76920
push id37649
push userbmo:poirot.alex@gmail.com
push dateWed, 30 Nov 2016 14:50:19 +0000
reviewerspbro
bugs1320790
milestone53.0a1
Bug 1320790 - Only inject gcli test helper in the inspect that use it. r=pbro MozReview-Commit-ID: 7Zc1Fe7Yygu
devtools/client/inspector/test/browser_inspector_gcli-inspect-command.js
devtools/client/inspector/test/head.js
--- a/devtools/client/inspector/test/browser_inspector_gcli-inspect-command.js
+++ b/devtools/client/inspector/test/browser_inspector_gcli-inspect-command.js
@@ -1,14 +1,21 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 /* eslint key-spacing: 0 */
+/* import-globals-from ../../commandline/test/helpers.js */
+
 "use strict";
 
+// Import the GCLI test helper
+Services.scriptloader.loadSubScript(
+  "chrome://mochitests/content/browser/devtools/client/commandline/test/helpers.js",
+  this);
+
 // Testing that the gcli 'inspect' command works as it should.
 
 const TEST_URI = URL_ROOT + "doc_inspector_gcli-inspect-command.html";
 
 add_task(function* () {
   return helpers.addTabWithToolbar(TEST_URI, Task.async(function* (options) {
     let {inspector} = yield openInspector();
 
--- a/devtools/client/inspector/test/head.js
+++ b/devtools/client/inspector/test/head.js
@@ -1,34 +1,28 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 /* eslint no-unused-vars: [2, {"vars": "local"}] */
 /* import-globals-from ../../framework/test/shared-head.js */
-/* import-globals-from ../../commandline/test/helpers.js */
 /* import-globals-from ../../shared/test/test-actor-registry.js */
 /* import-globals-from ../../inspector/test/shared-head.js */
 "use strict";
 
 // Load the shared-head file first.
 Services.scriptloader.loadSubScript(
   "chrome://mochitests/content/browser/devtools/client/framework/test/shared-head.js",
   this);
 
 // Services.prefs.setBoolPref("devtools.debugger.log", true);
 // SimpleTest.registerCleanupFunction(() => {
 //   Services.prefs.clearUserPref("devtools.debugger.log");
 // });
 
-// Import the GCLI test helper
-Services.scriptloader.loadSubScript(
-  "chrome://mochitests/content/browser/devtools/client/commandline/test/helpers.js",
-  this);
-
 // Import helpers registering the test-actor in remote targets
 Services.scriptloader.loadSubScript(
   "chrome://mochitests/content/browser/devtools/client/shared/test/test-actor-registry.js",
   this);
 
 // 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",