Bug 1203159 - Clean up various incorrect paths. r=ochameau draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Tue, 20 Oct 2015 09:41:10 -0500
changeset 302036 ce168ee6f910dea544b472c5025f3db764e1527d
parent 302035 e924e0ca81f701cc46dc25ee4fde0e8cc5ec7705
child 302037 a6a6deb457606ebe1e985b917f74bb67ce28aca7
push id6546
push userjryans@gmail.com
push dateTue, 20 Oct 2015 14:46:47 +0000
reviewersochameau
bugs1203159
milestone44.0a1
Bug 1203159 - Clean up various incorrect paths. r=ochameau
b2g/simulator/bootstrap.js
browser/base/content/sanitize.js
browser/components/newtab/PlacesProvider.jsm
devtools/client/framework/toolbox.js
devtools/client/memory/test/mochitest/head.js
devtools/client/shared/test/unit/test_escapeCSSComment.js
devtools/client/shared/test/unit/test_parseDeclarations.js
devtools/client/shared/test/unit/test_parsePseudoClassesAndAttributes.js
devtools/client/shared/test/unit/test_parseSingleValue.js
devtools/client/shared/test/unit/test_rewriteDeclarations.js
testing/eslint-plugin-mozilla/docs/components-imports.rst
testing/eslint-plugin-mozilla/docs/import-headjs-globals.rst
testing/eslint-plugin-mozilla/lib/helpers.js
--- a/b2g/simulator/bootstrap.js
+++ b/b2g/simulator/bootstrap.js
@@ -26,17 +26,17 @@ function uninstall(data, reason) {}
 
 function startup(data, reason) {
   let uri = registerAddonResourceHandler(data);
 
   let loaderModule =
     Cu.import('resource://gre/modules/commonjs/toolkit/loader.js').Loader;
   let { Loader, Require, Main } = loaderModule;
 
-  const { ConsoleAPI } = Cu.import("resource://devtools/shared/Console.jsm");
+  const { ConsoleAPI } = Cu.import("resource://gre/modules/Console.jsm");
 
   let loader = Loader({
     paths: {
       "./": uri + "lib/",
       "": "resource://gre/modules/commonjs/"
     },
     globals: {
       console: new ConsoleAPI({
@@ -59,9 +59,8 @@ function startup(data, reason) {
 
 function shutdown(data, reason) {
   if (mainModule && mainModule.shutdown) {
     mainModule.shutdown();
   }
 }
 
 function uninstall(data, reason) {}
-
--- a/browser/base/content/sanitize.js
+++ b/browser/base/content/sanitize.js
@@ -17,17 +17,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon",
                                   "resource:///modules/DownloadsCommon.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
                                   "resource://gre/modules/TelemetryStopwatch.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "console",
-                                  "resource://devtools/Console.jsm");
+                                  "resource://gre/modules/Console.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Preferences",
                                   "resource://gre/modules/Preferences.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
                                   "resource://gre/modules/Timer.jsm");
 
 /**
  * A number of iterations after which to yield time back
  * to the system.
--- a/browser/components/newtab/PlacesProvider.jsm
+++ b/browser/components/newtab/PlacesProvider.jsm
@@ -16,17 +16,17 @@ Cu.import("resource://gre/modules/XPCOMU
 
 XPCOMUtils.defineLazyModuleGetter(this, "BinarySearch",
   "resource://gre/modules/BinarySearch.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
   "resource://gre/modules/PlacesUtils.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "EventEmitter", function() {
-  const {EventEmitter} = Cu.import("resource://devtools/event-emitter.js", {});
+  const {EventEmitter} = Cu.import("resource://devtools/shared/event-emitter.js", {});
   return EventEmitter;
 });
 
 XPCOMUtils.defineLazyGetter(this, "gPrincipal", function() {
   let uri = Services.io.newURI("about:newtab", null, null);
   return Services.scriptSecurityManager.getNoAppCodebasePrincipal(uri);
 });
 
--- a/devtools/client/framework/toolbox.js
+++ b/devtools/client/framework/toolbox.js
@@ -1642,17 +1642,17 @@ Toolbox.prototype = {
 
     // clean up the toolbox if its window is closed
     let newHost = new Hosts[hostType](this.target.tab, options);
     newHost.on("window-closed", this.destroy);
     return newHost;
   },
 
   reload: function () {
-    const {devtools} = Cu.import("resource://devtools/Loader.jsm", {});
+    const {devtools} = Cu.import("resource://devtools/shared/Loader.jsm", {});
     devtools.reload(true);
   },
 
   /**
    * Switch to the last used host for the toolbox UI.
    * This is determined by the devtools.toolbox.previousHost pref.
    */
   switchToPreviousHost: function() {
--- a/devtools/client/memory/test/mochitest/head.js
+++ b/devtools/client/memory/test/mochitest/head.js
@@ -4,9 +4,9 @@
 "use strict";
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 var CC = Components.Constructor;
 
-const { require } = Cu.import("resource://devtools/Loader.jsm", {});
+const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
--- a/devtools/client/shared/test/unit/test_escapeCSSComment.js
+++ b/devtools/client/shared/test/unit/test_escapeCSSComment.js
@@ -1,17 +1,17 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 var Cu = Components.utils;
-Cu.import("resource://devtools/Loader.jsm");
+Cu.import("resource://devtools/shared/Loader.jsm");
 const {escapeCSSComment, _unescapeCSSComment} =
       devtools.require("devtools/client/shared/css-parsing-utils");
 
 const TEST_DATA = [
   {
     input: "simple",
     expected: "simple"
   },
--- a/devtools/client/shared/test/unit/test_parseDeclarations.js
+++ b/devtools/client/shared/test/unit/test_parseDeclarations.js
@@ -1,17 +1,17 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 var Cu = Components.utils;
-const {require} = Cu.import("resource://devtools/Loader.jsm", {});
+const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
 const {parseDeclarations, _parseCommentDeclarations} =
   require("devtools/client/shared/css-parsing-utils");
 
 const TEST_DATA = [
   // Simple test
   {
     input: "p:v;",
     expected: [{name: "p", value: "v", priority: "", offsets: [0, 4]}]
--- a/devtools/client/shared/test/unit/test_parsePseudoClassesAndAttributes.js
+++ b/devtools/client/shared/test/unit/test_parsePseudoClassesAndAttributes.js
@@ -1,17 +1,17 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 var Cu = Components.utils;
-const {require} = Cu.import("resource://devtools/Loader.jsm", {});
+const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
 const {
   parsePseudoClassesAndAttributes,
   SELECTOR_ATTRIBUTE,
   SELECTOR_ELEMENT,
   SELECTOR_PSEUDO_CLASS
 } = require("devtools/client/shared/css-parsing-utils");
 
 const TEST_DATA = [
--- a/devtools/client/shared/test/unit/test_parseSingleValue.js
+++ b/devtools/client/shared/test/unit/test_parseSingleValue.js
@@ -1,17 +1,17 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 var Cu = Components.utils;
-const {require} = Cu.import("resource://devtools/Loader.jsm", {});
+const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
 const {parseSingleValue} = require("devtools/client/shared/css-parsing-utils");
 
 const TEST_DATA = [
   {input: null, throws: true},
   {input: undefined, throws: true},
   {input: "", expected: {value: "", priority: ""}},
   {input: "  \t \t \n\n  ", expected: {value: "", priority: ""}},
   {input: "blue", expected: {value: "blue", priority: ""}},
--- a/devtools/client/shared/test/unit/test_rewriteDeclarations.js
+++ b/devtools/client/shared/test/unit/test_rewriteDeclarations.js
@@ -1,17 +1,17 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 var Cu = Components.utils;
-Cu.import("resource://devtools/Loader.jsm");
+Cu.import("resource://devtools/shared/Loader.jsm");
 const {parseDeclarations, RuleRewriter} =
       devtools.require("devtools/client/shared/css-parsing-utils");
 
 const TEST_DATA = [
   {
     desc: "simple set",
     input: "p:v;",
     instruction: {type: "set", name: "p", value: "N", priority: "",
--- a/testing/eslint-plugin-mozilla/docs/components-imports.rst
+++ b/testing/eslint-plugin-mozilla/docs/components-imports.rst
@@ -7,15 +7,15 @@ components-imports
 Rule Details
 ------------
 
 Adds the filename of imported files e.g.
 ``Cu.import("some/path/Blah.jsm")`` adds Blah to the global scope.
 
 The following patterns are supported:
 
--  ``Cu.import("resource://devtools/ViewHelpers.jsm");``
+-  ``Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");``
 -  ``loader.lazyImporter(this, "name1");``
 -  ``loader.lazyRequireGetter(this, "name2"``
 -  ``loader.lazyServiceGetter(this, "name3"``
 -  ``XPCOMUtils.defineLazyModuleGetter(this, "setNamedTimeout", ...)``
 -  ``loader.lazyGetter(this, "toolboxStrings"``
 -  ``XPCOMUtils.defineLazyGetter(this, "clipboardHelper"``
--- a/testing/eslint-plugin-mozilla/docs/import-headjs-globals.rst
+++ b/testing/eslint-plugin-mozilla/docs/import-headjs-globals.rst
@@ -17,15 +17,15 @@ The following file import patterns are s
 -  ``loadSubScript(path)``
 -  ``loadHelperScript(path)``
 
 If path does not exist because it is generated e.g.
 ``testdir + "/somefile.js"`` we do our best to resolve it.
 
 The following patterns are supported:
 
--  ``Cu.import("resource://devtools/ViewHelpers.jsm");``
+-  ``Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");``
 -  ``loader.lazyImporter(this, "name1");``
 -  ``loader.lazyRequireGetter(this, "name2"``
 -  ``loader.lazyServiceGetter(this, "name3"``
 -  ``XPCOMUtils.defineLazyModuleGetter(this, "setNamedTimeout", ...)``
 -  ``loader.lazyGetter(this, "toolboxStrings"``
 -  ``XPCOMUtils.defineLazyGetter(this, "clipboardHelper"``
--- a/testing/eslint-plugin-mozilla/lib/helpers.js
+++ b/testing/eslint-plugin-mozilla/lib/helpers.js
@@ -58,17 +58,17 @@ module.exports = {
                                   .replace(/\s+/g, " ");
   },
 
   /**
    * Gets the variable name from an import source
    * e.g. Cu.import("path/to/someName") will return "someName."
    *
    * Some valid input strings:
-   *  - Cu.import("resource://devtools/ViewHelpers.jsm");
+   *  - Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
    *  - loader.lazyImporter(this, "name1");
    *  - loader.lazyRequireGetter(this, "name2"
    *  - loader.lazyServiceGetter(this, "name3"
    *  - XPCOMUtils.defineLazyModuleGetter(this, "setNamedTimeout", ...)
    *  - loader.lazyGetter(this, "toolboxStrings"
    *  - XPCOMUtils.defineLazyGetter(this, "clipboardHelper"
    *
    * @param  {String} source