Bug 952307 - Move some addon-private JSM's to a subdirectory. r=Unfocused
authorAlexander J. Vincent <ajvincent@gmail.com>
Tue, 07 Jan 2014 20:14:08 -0800
changeset 170118 70df8261030ad1f018a4b1e880b1e0a1fd5bb182
parent 170117 d7f05ca315a6f39832a6952fb7ec4c70c3baec27
child 170119 db540bc426141aa5ca206c8da185f702fa4f8090
push id26277
push userphilringnalda@gmail.com
push dateSun, 23 Feb 2014 17:00:29 +0000
treeherdermozilla-central@31113754db3b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersUnfocused
bugs952307
milestone30.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 952307 - Move some addon-private JSM's to a subdirectory. r=Unfocused
addon-sdk/source/lib/sdk/l10n/locale.js
addon-sdk/source/python-lib/cuddlefish/preflight.py
mobile/android/components/AddonUpdateService.js
services/sync/modules/addonutils.js
services/sync/modules/engines/addons.js
services/sync/tps/extensions/tps/modules/addons.jsm
toolkit/modules/LightweightThemeConsumer.jsm
toolkit/mozapps/extensions/AddonLogging.jsm
toolkit/mozapps/extensions/AddonManager.jsm
toolkit/mozapps/extensions/AddonRepository.jsm
toolkit/mozapps/extensions/AddonRepository_SQLiteMigrator.jsm
toolkit/mozapps/extensions/AddonUpdateChecker.jsm
toolkit/mozapps/extensions/DeferredSave.jsm
toolkit/mozapps/extensions/LightweightThemeImageOptimizer.jsm
toolkit/mozapps/extensions/LightweightThemeManager.jsm
toolkit/mozapps/extensions/PluginProvider.jsm
toolkit/mozapps/extensions/SpellCheckDictionaryBootstrap.js
toolkit/mozapps/extensions/XPIProvider.jsm
toolkit/mozapps/extensions/XPIProviderUtils.js
toolkit/mozapps/extensions/amWebInstallListener.js
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/content/selectAddons.js
toolkit/mozapps/extensions/content/update.js
toolkit/mozapps/extensions/extensions.manifest
toolkit/mozapps/extensions/internal/AddonLogging.jsm
toolkit/mozapps/extensions/internal/AddonRepository.jsm
toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm
toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm
toolkit/mozapps/extensions/internal/LightweightThemeImageOptimizer.jsm
toolkit/mozapps/extensions/internal/PluginProvider.jsm
toolkit/mozapps/extensions/internal/SpellCheckDictionaryBootstrap.js
toolkit/mozapps/extensions/internal/XPIProvider.jsm
toolkit/mozapps/extensions/internal/XPIProviderUtils.js
toolkit/mozapps/extensions/internal/moz.build
toolkit/mozapps/extensions/moz.build
toolkit/mozapps/extensions/test/browser/browser_addonrepository_performance.js
toolkit/mozapps/extensions/test/browser/browser_bug581076.js
toolkit/mozapps/extensions/test/browser/browser_metadataTimeout.js
toolkit/mozapps/extensions/test/browser/browser_updatessl.js
toolkit/mozapps/extensions/test/xpcshell/head_addons.js
toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository.js
toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js
toolkit/mozapps/extensions/test/xpcshell/test_XPIcancel.js
toolkit/mozapps/extensions/test/xpcshell/test_bug424262.js
toolkit/mozapps/extensions/test/xpcshell/test_bug554133.js
toolkit/mozapps/extensions/test/xpcshell/test_no_addons.js
toolkit/mozapps/extensions/test/xpcshell/test_pluginchange.js
toolkit/mozapps/extensions/test/xpcshell/test_syncGUID.js
toolkit/mozapps/extensions/test/xpcshell/test_updatecheck.js
--- a/addon-sdk/source/lib/sdk/l10n/locale.js
+++ b/addon-sdk/source/lib/sdk/l10n/locale.js
@@ -70,17 +70,17 @@ exports.getPreferedLocales = function ge
  * @param  aLocales
  *         An array of available locales
  * @param  aMatchLocales
  *         An array of prefered locales, ordered by priority. Most wanted first.
  *         Locales have to be in lowercase.
  *         If null, uses getPreferedLocales() results
  * @return the best match for the currently selected locale
  *
- * Stolen from http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/XPIProvider.jsm
+ * Stolen from http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/internal/XPIProvider.jsm
  */
 exports.findClosestLocale = function findClosestLocale(aLocales, aMatchLocales) {
 
   aMatchLocales = aMatchLocales || exports.getPreferedLocales();
 
   // Holds the best matching localized resource
   let bestmatch = null;
   // The number of locale parts it matched with
--- a/addon-sdk/source/python-lib/cuddlefish/preflight.py
+++ b/addon-sdk/source/python-lib/cuddlefish/preflight.py
@@ -11,17 +11,17 @@ def create_jid():
     previous jid0- series, the string securely identified a specific public
     key). To get a suitable add-on ID, append '@jetpack' to this string.
     """
     # per https://developer.mozilla.org/en/Install_Manifests#id all XPI id
     # values must either be in the form of a 128-bit GUID (crazy braces
     # and all) or in the form of an email address (crazy @ and all).
     # Firefox will refuse to install an add-on with an id that doesn't
     # match one of these forms. The actual regexp is at:
-    # http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/XPIProvider.jsm#130
+    # http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/internal/XPIProvider.jsm#130
     # So the JID needs an @-suffix, and the only legal punctuation is
     # "-._". So we start with a base64 encoding, and replace the
     # punctuation (+/) with letters (AB), losing a few bits of integrity.
 
     # even better: windows has a maximum path length limitation of 256
     # characters:
     #  http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx
     # (unless all paths are prefixed with "\\?\", I kid you not). The
--- a/mobile/android/components/AddonUpdateService.js
+++ b/mobile/android/components/AddonUpdateService.js
@@ -8,17 +8,17 @@ const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
                                   "resource://gre/modules/AddonManager.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
-                                  "resource://gre/modules/AddonRepository.jsm");
+                                  "resource://gre/modules/addons/AddonRepository.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
 
 function getPref(func, preference, defaultValue) {
   try {
     return Services.prefs[func](preference);
   }
   catch (e) {}
--- a/services/sync/modules/addonutils.js
+++ b/services/sync/modules/addonutils.js
@@ -10,17 +10,17 @@ const {interfaces: Ci, utils: Cu} = Comp
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Log.jsm");
 Cu.import("resource://services-sync/util.js");
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
   "resource://gre/modules/AddonManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
-  "resource://gre/modules/AddonRepository.jsm");
+  "resource://gre/modules/addons/AddonRepository.jsm");
 
 function AddonUtilsInternal() {
   this._log = Log.repository.getLogger("Sync.AddonUtils");
   this._log.Level = Log.Level[Svc.Prefs.get("log.logger.addonutils")];
 }
 AddonUtilsInternal.prototype = {
   /**
    * Obtain an AddonInstall object from an AddonSearchResult instance.
--- a/services/sync/modules/engines/addons.js
+++ b/services/sync/modules/engines/addons.js
@@ -43,17 +43,17 @@ Cu.import("resource://services-sync/util
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-common/async.js");
 
 Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
                                   "resource://gre/modules/AddonManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
-                                  "resource://gre/modules/AddonRepository.jsm");
+                                  "resource://gre/modules/addons/AddonRepository.jsm");
 
 this.EXPORTED_SYMBOLS = ["AddonsEngine"];
 
 // 7 days in milliseconds.
 const PRUNE_ADDON_CHANGES_THRESHOLD = 60 * 60 * 24 * 7 * 1000;
 
 /**
  * AddonRecord represents the state of an add-on in an application.
--- a/services/sync/tps/extensions/tps/modules/addons.jsm
+++ b/services/sync/tps/extensions/tps/modules/addons.jsm
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 let EXPORTED_SYMBOLS = ["Addon", "STATE_ENABLED", "STATE_DISABLED"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/AddonManager.jsm");
-Cu.import("resource://gre/modules/AddonRepository.jsm");
+Cu.import("resource://gre/modules/addons/AddonRepository.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://services-common/async.js");
 Cu.import("resource://services-sync/addonutils.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://tps/logger.jsm");
 
 const ADDONSGETURL = 'http://127.0.0.1:4567/';
 const STATE_ENABLED = 1;
--- a/toolkit/modules/LightweightThemeConsumer.jsm
+++ b/toolkit/modules/LightweightThemeConsumer.jsm
@@ -2,17 +2,17 @@
  * 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/. */
 
 this.EXPORTED_SYMBOLS = ["LightweightThemeConsumer"];
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer",
-  "resource://gre/modules/LightweightThemeImageOptimizer.jsm");
+  "resource://gre/modules/addons/LightweightThemeImageOptimizer.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
   "resource://gre/modules/PrivateBrowsingUtils.jsm");
 
 this.LightweightThemeConsumer =
  function LightweightThemeConsumer(aDocument) {
   this._doc = aDocument;
   this._win = aDocument.defaultView;
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -59,38 +59,38 @@ const VALID_TYPES_REGEXP = /^[\w\-]+$/;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/AsyncShutdown.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
-                                  "resource://gre/modules/AddonRepository.jsm");
+                                  "resource://gre/modules/addons/AddonRepository.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "CertUtils", function certUtilsLazyGetter() {
   let certUtils = {};
   Components.utils.import("resource://gre/modules/CertUtils.jsm", certUtils);
   return certUtils;
 });
 
 
 this.EXPORTED_SYMBOLS = [ "AddonManager", "AddonManagerPrivate" ];
 
 const CATEGORY_PROVIDER_MODULE = "addon-provider-module";
 
 // A list of providers to load by default
 const DEFAULT_PROVIDERS = [
-  "resource://gre/modules/XPIProvider.jsm",
+  "resource://gre/modules/addons/XPIProvider.jsm",
   "resource://gre/modules/LightweightThemeManager.jsm"
 ];
 
 ["LOG", "WARN", "ERROR"].forEach(function(aName) {
   this.__defineGetter__(aName, function logFuncGetter() {
-    Components.utils.import("resource://gre/modules/AddonLogging.jsm");
+    Components.utils.import("resource://gre/modules/addons/AddonLogging.jsm");
 
     LogManager.getLogger("addons.manager", this);
     return this[aName];
   });
 }, this);
 
 /**
  * Calls a callback method consuming any thrown exception. Any parameters after
@@ -1067,17 +1067,17 @@ var AddonManagerInternal = {
       url = AddonManager.escapeAddonURI({
         id: hotfixID,
         version: hotfixVersion,
         userDisabled: false,
         appDisabled: false
       }, url);
 
       pendingUpdates++;
-      Components.utils.import("resource://gre/modules/AddonUpdateChecker.jsm");
+      Components.utils.import("resource://gre/modules/addons/AddonUpdateChecker.jsm");
       AddonUpdateChecker.checkForUpdates(hotfixID, null, url, {
         onUpdateCheckComplete: function BUC_onUpdateCheckComplete(aUpdates) {
           let update = AddonUpdateChecker.getNewestCompatibleUpdate(aUpdates);
           if (!update) {
             notifyComplete();
             return;
           }
 
--- a/toolkit/mozapps/extensions/DeferredSave.jsm
+++ b/toolkit/mozapps/extensions/DeferredSave.jsm
@@ -39,17 +39,17 @@ const DEFAULT_SAVE_DELAY_MS = 50;
  * @param [optional] aDelay
  *        The delay in milliseconds between the first saveChanges() call
  *        that marks the data as needing to be saved, and when the DeferredSave
  *        begins writing the data to disk. Default 50 milliseconds.
  */
 this.DeferredSave = function (aPath, aDataProvider, aDelay) {
   // Set up loggers for this instance of DeferredSave
   let leafName = OS.Path.basename(aPath);
-  Cu.import("resource://gre/modules/AddonLogging.jsm");
+  Cu.import("resource://gre/modules/addons/AddonLogging.jsm");
   LogManager.getLogger("DeferredSave/" + leafName, this);
 
   // @type {Deferred|null}, null when no data needs to be written
   // @resolves with the result of OS.File.writeAtomic when all writes complete
   // @rejects with the error from OS.File.writeAtomic if the write fails,
   //          or with the error from aDataProvider() if that throws.
   this._pending = null;
 
--- a/toolkit/mozapps/extensions/LightweightThemeManager.jsm
+++ b/toolkit/mozapps/extensions/LightweightThemeManager.jsm
@@ -35,17 +35,17 @@ const OPTIONAL = ["footerURL", "textcolo
 const PERSIST_ENABLED = true;
 const PERSIST_BYPASS_CACHE = false;
 const PERSIST_FILES = {
   headerURL: "lightweighttheme-header",
   footerURL: "lightweighttheme-footer"
 };
 
 XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer",
-  "resource://gre/modules/LightweightThemeImageOptimizer.jsm");
+  "resource://gre/modules/addons/LightweightThemeImageOptimizer.jsm");
 
 this.__defineGetter__("_prefs", function prefsGetter() {
   delete this._prefs;
   return this._prefs = Services.prefs.getBranch("lightweightThemes.");
 });
 
 this.__defineGetter__("_maxUsedThemes", function maxUsedThemesGetter() {
   delete this._maxUsedThemes;
--- a/toolkit/mozapps/extensions/amWebInstallListener.js
+++ b/toolkit/mozapps/extensions/amWebInstallListener.js
@@ -26,17 +26,17 @@ const READY_STATES = [
   AddonManager.STATE_AVAILABLE,
   AddonManager.STATE_DOWNLOAD_FAILED,
   AddonManager.STATE_INSTALL_FAILED,
   AddonManager.STATE_CANCELLED
 ];
 
 ["LOG", "WARN", "ERROR"].forEach(function(aName) {
   this.__defineGetter__(aName, function logFuncGetter() {
-    Components.utils.import("resource://gre/modules/AddonLogging.jsm");
+    Components.utils.import("resource://gre/modules/addons/AddonLogging.jsm");
 
     LogManager.getLogger("addons.weblistener", this);
     return this[aName];
   });
 }, this);
 
 function notifyObservers(aTopic, aWindow, aUri, aInstalls) {
   let info = {
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -10,17 +10,17 @@ const Cu = Components.utils;
 const Cr = Components.results;
 
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/PluralForm.jsm");
 Cu.import("resource://gre/modules/DownloadUtils.jsm");
 Cu.import("resource://gre/modules/AddonManager.jsm");
-Cu.import("resource://gre/modules/AddonRepository.jsm");
+Cu.import("resource://gre/modules/addons/AddonRepository.jsm");
 
 
 const PREF_DISCOVERURL = "extensions.webservice.discoverURL";
 const PREF_DISCOVER_ENABLED = "extensions.getAddons.showPane";
 const PREF_XPI_ENABLED = "xpinstall.enabled";
 const PREF_MAXRESULTS = "extensions.getAddons.maxResults";
 const PREF_GETADDONS_CACHE_ENABLED = "extensions.getAddons.cache.enabled";
 const PREF_GETADDONS_CACHE_ID_ENABLED = "extensions.%ID%.getAddons.cache.enabled";
--- a/toolkit/mozapps/extensions/content/selectAddons.js
+++ b/toolkit/mozapps/extensions/content/selectAddons.js
@@ -2,17 +2,17 @@
 
 /* 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/. */
 
 "use strict";
 
 Components.utils.import("resource://gre/modules/AddonManager.jsm");
-Components.utils.import("resource://gre/modules/AddonRepository.jsm");
+Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm");
 Components.utils.import("resource://gre/modules/Services.jsm");
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
 var gView = null;
 
 function showView(aView) {
--- a/toolkit/mozapps/extensions/content/update.js
+++ b/toolkit/mozapps/extensions/content/update.js
@@ -12,17 +12,17 @@ const PREF_UPDATE_EXTENSIONS_ENABLED    
 const PREF_XPINSTALL_ENABLED                    = "xpinstall.enabled";
 const PREF_EM_HOTFIX_ID                         = "extensions.hotfix.id";
 
 // timeout (in milliseconds) to wait for response to the metadata ping
 const METADATA_TIMEOUT    = 30000;
 
 Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://gre/modules/AddonManager.jsm");
-Components.utils.import("resource://gre/modules/AddonRepository.jsm");
+Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm");
 
 
 var gInteruptable = true;
 var gPendingClose = false;
 
 
 var gUpdateWizard = {
   // When synchronizing app compatibility info this contains all installed
--- a/toolkit/mozapps/extensions/extensions.manifest
+++ b/toolkit/mozapps/extensions/extensions.manifest
@@ -4,10 +4,10 @@ contract @mozilla.org/extensions/blockli
 category update-timer nsBlocklistService @mozilla.org/extensions/blocklist;1,getService,blocklist-background-update-timer,extensions.blocklist.interval,86400
 component {4399533d-08d1-458c-a87a-235f74451cfa} addonManager.js
 contract @mozilla.org/addons/integration;1 {4399533d-08d1-458c-a87a-235f74451cfa}
 category update-timer addonManager @mozilla.org/addons/integration;1,getService,addon-background-update-timer,extensions.update.interval,86400
 component {7beb3ba8-6ec3-41b4-b67c-da89b8518922} amContentHandler.js
 contract @mozilla.org/uriloader/content-handler;1?type=application/x-xpinstall {7beb3ba8-6ec3-41b4-b67c-da89b8518922}
 component {0f38e086-89a3-40a5-8ffc-9b694de1d04a} amWebInstallListener.js
 contract @mozilla.org/addons/web-install-listener;1 {0f38e086-89a3-40a5-8ffc-9b694de1d04a}
-category addon-provider-module PluginProvider resource://gre/modules/PluginProvider.jsm
+category addon-provider-module PluginProvider resource://gre/modules/addons/PluginProvider.jsm
 #endif
rename from toolkit/mozapps/extensions/AddonLogging.jsm
rename to toolkit/mozapps/extensions/internal/AddonLogging.jsm
rename from toolkit/mozapps/extensions/AddonRepository.jsm
rename to toolkit/mozapps/extensions/internal/AddonRepository.jsm
--- a/toolkit/mozapps/extensions/AddonRepository.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonRepository.jsm
@@ -17,17 +17,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DeferredSave",
                                   "resource://gre/modules/DeferredSave.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository_SQLiteMigrator",
-                                  "resource://gre/modules/AddonRepository_SQLiteMigrator.jsm");
+                                  "resource://gre/modules/addons/AddonRepository_SQLiteMigrator.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 
 this.EXPORTED_SYMBOLS = [ "AddonRepository" ];
 
 const PREF_GETADDONS_CACHE_ENABLED       = "extensions.getAddons.cache.enabled";
 const PREF_GETADDONS_CACHE_TYPES         = "extensions.getAddons.cache.types";
 const PREF_GETADDONS_CACHE_ID_ENABLED    = "extensions.%ID%.getAddons.cache.enabled"
@@ -58,17 +58,17 @@ const BLANK_DB = function() {
     schema: DB_SCHEMA
   };
 }
 
 const TOOLKIT_ID     = "toolkit@mozilla.org";
 
 ["LOG", "WARN", "ERROR"].forEach(function(aName) {
   this.__defineGetter__(aName, function logFuncGetter() {
-    Components.utils.import("resource://gre/modules/AddonLogging.jsm");
+    Components.utils.import("resource://gre/modules/addons/AddonLogging.jsm");
 
     LogManager.getLogger("addons.repository", this);
     return this[aName];
   });
 }, this);
 
 // A map between XML keys to AddonSearchResult keys for string values
 // that require no extra parsing from XML
rename from toolkit/mozapps/extensions/AddonRepository_SQLiteMigrator.jsm
rename to toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm
--- a/toolkit/mozapps/extensions/AddonRepository_SQLiteMigrator.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm
@@ -22,17 +22,17 @@ const PROP_SINGLE = ["id", "type", "name
                      "contributionAmount", "averageRating", "reviewCount",
                      "reviewURL", "totalDownloads", "weeklyDownloads",
                      "dailyUsers", "sourceURI", "repositoryStatus", "size",
                      "updateDate"];
 
 
 ["LOG", "WARN", "ERROR"].forEach(function(aName) {
   this.__defineGetter__(aName, function logFuncGetter() {
-    Components.utils.import("resource://gre/modules/AddonLogging.jsm");
+    Components.utils.import("resource://gre/modules/addons/AddonLogging.jsm");
 
     LogManager.getLogger("addons.repository.sqlmigrator", this);
     return this[aName];
   });
 }, this);
 
 
 this.EXPORTED_SYMBOLS = ["AddonRepository_SQLiteMigrator"];
rename from toolkit/mozapps/extensions/AddonUpdateChecker.jsm
rename to toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm
--- a/toolkit/mozapps/extensions/AddonUpdateChecker.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm
@@ -27,31 +27,31 @@ const XMLURI_PARSE_ERROR    = "http://ww
 const PREF_UPDATE_REQUIREBUILTINCERTS = "extensions.update.requireBuiltInCerts";
 
 Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
                                   "resource://gre/modules/AddonManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
-                                  "resource://gre/modules/AddonRepository.jsm");
+                                  "resource://gre/modules/addons/AddonRepository.jsm");
 
 // Shared code for suppressing bad cert dialogs.
 XPCOMUtils.defineLazyGetter(this, "CertUtils", function certUtilsLazyGetter() {
   let certUtils = {};
   Components.utils.import("resource://gre/modules/CertUtils.jsm", certUtils);
   return certUtils;
 });
 
 var gRDF = Cc["@mozilla.org/rdf/rdf-service;1"].
            getService(Ci.nsIRDFService);
 
 ["LOG", "WARN", "ERROR"].forEach(function(aName) {
   this.__defineGetter__(aName, function logFuncGetter() {
-    Components.utils.import("resource://gre/modules/AddonLogging.jsm");
+    Components.utils.import("resource://gre/modules/addons/AddonLogging.jsm");
 
     LogManager.getLogger("addons.updates", this);
     return this[aName];
   });
 }, this);
 
 
 /**
rename from toolkit/mozapps/extensions/LightweightThemeImageOptimizer.jsm
rename to toolkit/mozapps/extensions/internal/LightweightThemeImageOptimizer.jsm
rename from toolkit/mozapps/extensions/PluginProvider.jsm
rename to toolkit/mozapps/extensions/internal/PluginProvider.jsm
--- a/toolkit/mozapps/extensions/PluginProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/PluginProvider.jsm
@@ -13,17 +13,17 @@ Components.utils.import("resource://gre/
 Components.utils.import("resource://gre/modules/Services.jsm");
 
 const URI_EXTENSION_STRINGS  = "chrome://mozapps/locale/extensions/extensions.properties";
 const STRING_TYPE_NAME       = "type.%ID%.name";
 const LIST_UPDATED_TOPIC     = "plugins-list-updated";
 
 for (let name of ["LOG", "WARN", "ERROR"]) {
   this.__defineGetter__(name, function() {
-    Components.utils.import("resource://gre/modules/AddonLogging.jsm");
+    Components.utils.import("resource://gre/modules/addons/AddonLogging.jsm");
 
     LogManager.getLogger("addons.plugins", this);
     return this[name];
   });
 }
 
 function getIDHashForString(aStr) {
   // return the two-digit hexadecimal code for a byte
rename from toolkit/mozapps/extensions/SpellCheckDictionaryBootstrap.js
rename to toolkit/mozapps/extensions/internal/SpellCheckDictionaryBootstrap.js
rename from toolkit/mozapps/extensions/XPIProvider.jsm
rename to toolkit/mozapps/extensions/internal/XPIProvider.jsm
--- a/toolkit/mozapps/extensions/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -11,17 +11,17 @@ const Cu = Components.utils;
 
 this.EXPORTED_SYMBOLS = [];
 
 Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 Components.utils.import("resource://gre/modules/AddonManager.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
-                                  "resource://gre/modules/AddonRepository.jsm");
+                                  "resource://gre/modules/addons/AddonRepository.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ChromeManifestParser",
                                   "resource://gre/modules/ChromeManifestParser.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
                                   "resource://gre/modules/LightweightThemeManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
@@ -190,17 +190,17 @@ var gGlobalScope = this;
 /**
  * Valid IDs fit this pattern.
  */
 var gIDTest = /^(\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\}|[a-z0-9-\._]*\@[a-z0-9-\._]+)$/i;
 
 ["LOG", "WARN", "ERROR"].forEach(function(aName) {
   Object.defineProperty(this, aName, {
     get: function logFuncGetter() {
-      Components.utils.import("resource://gre/modules/AddonLogging.jsm");
+      Components.utils.import("resource://gre/modules/addons/AddonLogging.jsm");
 
       LogManager.getLogger("addons.xpi", this);
       return this[aName];
     },
     configurable: true
   });
 }, this);
 
@@ -208,17 +208,17 @@ var gIDTest = /^(\{[0-9a-f]{8}-[0-9a-f]{
 const LAZY_OBJECTS = ["XPIDatabase"];
 
 var gLazyObjectsLoaded = false;
 
 function loadLazyObjects() {
   let scope = {};
   scope.AddonInternal = AddonInternal;
   scope.XPIProvider = XPIProvider;
-  Services.scriptloader.loadSubScript("resource://gre/modules/XPIProviderUtils.js",
+  Services.scriptloader.loadSubScript("resource://gre/modules/addons/XPIProviderUtils.js",
                                       scope);
 
   for (let name of LAZY_OBJECTS) {
     delete gGlobalScope[name];
     gGlobalScope[name] = scope[name];
   }
   gLazyObjectsLoaded = true;
   return scope;
@@ -4227,17 +4227,17 @@ var XPIProvider = {
       for (let feature of features)
         this.bootstrapScopes[aId][feature] = gGlobalScope[feature];
 
       // As we don't want our caller to control the JS version used for the
       // bootstrap file, we run loadSubScript within the context of the
       // sandbox with the latest JS version set explicitly.
       if (aType == "dictionary") {
         this.bootstrapScopes[aId].__SCRIPT_URI_SPEC__ =
-            "resource://gre/modules/SpellCheckDictionaryBootstrap.js"
+            "resource://gre/modules/addons/SpellCheckDictionaryBootstrap.js"
       } else {
         this.bootstrapScopes[aId].__SCRIPT_URI_SPEC__ = uri;
       }
       Components.utils.evalInSandbox(
         "Components.classes['@mozilla.org/moz/jssubscript-loader;1'] \
                    .createInstance(Components.interfaces.mozIJSSubScriptLoader) \
                    .loadSubScript(__SCRIPT_URI_SPEC__);", this.bootstrapScopes[aId], "ECMAv5");
     }
@@ -5908,17 +5908,17 @@ AddonInstallWrapper.prototype = {};
  * @param  aPlatformVersion
  *         An optional platform version to check for updates for
  * @throws if the aListener or aReason arguments are not valid
  */
 function UpdateChecker(aAddon, aListener, aReason, aAppVersion, aPlatformVersion) {
   if (!aListener || !aReason)
     throw Cr.NS_ERROR_INVALID_ARG;
 
-  Components.utils.import("resource://gre/modules/AddonUpdateChecker.jsm");
+  Components.utils.import("resource://gre/modules/addons/AddonUpdateChecker.jsm");
 
   this.addon = aAddon;
   aAddon._updateCheck = this;
   XPIProvider.doing(this);
   this.listener = aListener;
   this.appVersion = aAppVersion;
   this.platformVersion = aPlatformVersion;
   this.syncCompatibility = (aReason == AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
rename from toolkit/mozapps/extensions/XPIProviderUtils.js
rename to toolkit/mozapps/extensions/internal/XPIProviderUtils.js
--- a/toolkit/mozapps/extensions/XPIProviderUtils.js
+++ b/toolkit/mozapps/extensions/internal/XPIProviderUtils.js
@@ -9,30 +9,30 @@ const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/AddonManager.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
-                                  "resource://gre/modules/AddonRepository.jsm");
+                                  "resource://gre/modules/addons/AddonRepository.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DeferredSave",
                                   "resource://gre/modules/DeferredSave.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 
 ["LOG", "WARN", "ERROR"].forEach(function(aName) {
   Object.defineProperty(this, aName, {
     get: function logFuncGetter () {
-      Cu.import("resource://gre/modules/AddonLogging.jsm");
+      Cu.import("resource://gre/modules/addons/AddonLogging.jsm");
 
       LogManager.getLogger("addons.xpi-utils", this);
       return this[aName];
     },
     configurable: true
   });
 }, this);
 
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/internal/moz.build
@@ -0,0 +1,30 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+JS_MODULES_PATH = 'modules/addons'
+
+EXTRA_JS_MODULES += [
+    'AddonLogging.jsm',
+    'AddonRepository.jsm',
+    'AddonRepository_SQLiteMigrator.jsm',
+    'AddonUpdateChecker.jsm',
+    'LightweightThemeImageOptimizer.jsm',
+    'PluginProvider.jsm',
+    'SpellCheckDictionaryBootstrap.js',
+]
+
+EXTRA_PP_JS_MODULES += [
+    'XPIProvider.jsm',
+    'XPIProviderUtils.js',
+]
+
+# This is used in multiple places, so is defined here to avoid it getting
+# out of sync.
+DEFINES['MOZ_EXTENSIONS_DB_SCHEMA'] = 16
+
+# Additional debugging info is exposed in debug builds
+if CONFIG['MOZ_EM_DEBUG']:
+    DEFINES['MOZ_EM_DEBUG'] = 1
--- a/toolkit/mozapps/extensions/moz.build
+++ b/toolkit/mozapps/extensions/moz.build
@@ -1,14 +1,15 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
+DIRS += ['internal']
 TEST_DIRS += ['test']
 
 XPIDL_SOURCES += [
     'amIAddonManager.idl',
     'amIInstallTrigger.idl',
     'amIWebInstaller.idl',
     'amIWebInstallListener.idl',
 ]
@@ -22,38 +23,25 @@ EXTRA_COMPONENTS += [
 ]
 
 EXTRA_PP_COMPONENTS += [
     'extensions.manifest',
     'nsBlocklistService.js',
 ]
 
 EXTRA_JS_MODULES += [
-    'AddonLogging.jsm',
-    'AddonRepository.jsm',
-    'AddonRepository_SQLiteMigrator.jsm',
-    'AddonUpdateChecker.jsm',
     'ChromeManifestParser.jsm',
     'DeferredSave.jsm',
-    'LightweightThemeImageOptimizer.jsm',
     'LightweightThemeManager.jsm',
-    'PluginProvider.jsm',
-    'SpellCheckDictionaryBootstrap.js',
 ]
 
 EXTRA_PP_JS_MODULES += [
-    'AddonManager.jsm',
-    'XPIProvider.jsm',
-    'XPIProviderUtils.js',
+    'AddonManager.jsm'
 ]
 
 if CONFIG['MOZ_UPDATE_CHANNEL'] not in ('aurora', 'beta', 'release', 'esr'):
     DEFINES['MOZ_COMPATIBILITY_NIGHTLY'] = 1
 
-# This is used in multiple places, so is defined here to avoid it getting
-# out of sync.
-DEFINES['MOZ_EXTENSIONS_DB_SCHEMA'] = 16
-
 # Additional debugging info is exposed in debug builds
 if CONFIG['MOZ_EM_DEBUG']:
     DEFINES['MOZ_EM_DEBUG'] = 1
 
 JAR_MANIFESTS += ['jar.mn']
--- a/toolkit/mozapps/extensions/test/browser/browser_addonrepository_performance.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_addonrepository_performance.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Tests that the metadata request includes startup time measurements
 
 let tmp = {};
-Components.utils.import("resource://gre/modules/AddonRepository.jsm", tmp);
+Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm", tmp);
 let AddonRepository = tmp.AddonRepository;
 
 var gTelemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
 var gManagerWindow;
 var gProvider;
 
 function parseParams(aQuery) {
   let params = {};
--- a/toolkit/mozapps/extensions/test/browser/browser_bug581076.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_bug581076.js
@@ -59,17 +59,17 @@ function search(aRemoteSearch, aCallback
 function check_allresultslink(aShouldShow) {
   var list = gManagerWindow.document.getElementById("search-list");
   var link = gManagerWindow.document.getElementById("search-allresults-link");
   is(link.parentNode, list.lastChild, "Footer should be at the end of the richlistbox");
   if (aShouldShow) {
     is_element_visible(link, "All Results link should be visible");
     is(link.value, "See all " + SEARCH_EXPECTED_TOTAL + " results", "All Results link should show the correct message");
     var scope = {};
-    Components.utils.import("resource://gre/modules/AddonRepository.jsm", scope);
+    Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm", scope);
     is(link.href, scope.AddonRepository.getSearchURL(SEARCH_QUERY), "All Results link should have the correct href");
   } else {
     is_element_hidden(link, "All Results link should be hidden");
   }
 }
 
 add_test(function() {
   info("Searching locally");
--- a/toolkit/mozapps/extensions/test/browser/browser_metadataTimeout.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_metadataTimeout.js
@@ -8,17 +8,17 @@
 const URI_EXTENSION_UPDATE_DIALOG = "chrome://mozapps/content/extensions/update.xul";
 
 const PREF_GETADDONS_BYIDS            = "extensions.getAddons.get.url";
 const PREF_MIN_PLATFORM_COMPAT        = "extensions.minCompatiblePlatformVersion";
 
 Components.utils.import("resource://gre/modules/Promise.jsm");
 
 let repo = {};
-let ARContext = Components.utils.import("resource://gre/modules/AddonRepository.jsm", repo);
+let ARContext = Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm", repo);
 info("ARContext: " + Object.keys(ARContext).join(", "));
 
 // Mock out the XMLHttpRequest factory for AddonRepository so
 // we can reply with a timeout
 let pXHRStarted = Promise.defer();
 let oldXHRConstructor = ARContext.XHRequest;
 ARContext.XHRequest = function() {
   this._handlers = new Map();
--- a/toolkit/mozapps/extensions/test/browser/browser_updatessl.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_updatessl.js
@@ -1,14 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 let tempScope = {};
-Components.utils.import("resource://gre/modules/AddonUpdateChecker.jsm", tempScope);
+Components.utils.import("resource://gre/modules/addons/AddonUpdateChecker.jsm", tempScope);
 let AddonUpdateChecker = tempScope.AddonUpdateChecker;
 
 const updaterdf = RELATIVE_DIR + "browser_updatessl.rdf";
 const redirect = RELATIVE_DIR + "redirect.sjs?";
 const SUCCESS = 0;
 const DOWNLOAD_ERROR = AddonUpdateChecker.ERROR_DOWNLOAD_ERROR;
 
 const HTTP = "http://example.com/";
--- a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
@@ -13,17 +13,17 @@ const PREF_EM_STRICT_COMPATIBILITY    = 
 const PREF_EM_MIN_COMPAT_APP_VERSION      = "extensions.minCompatibleAppVersion";
 const PREF_EM_MIN_COMPAT_PLATFORM_VERSION = "extensions.minCompatiblePlatformVersion";
 const PREF_GETADDONS_BYIDS               = "extensions.getAddons.get.url";
 const PREF_GETADDONS_BYIDS_PERFORMANCE   = "extensions.getAddons.getWithPerformance.url";
 
 // Forcibly end the test if it runs longer than 15 minutes
 const TIMEOUT_MS = 900000;
 
-Components.utils.import("resource://gre/modules/AddonRepository.jsm");
+Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm");
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 Components.utils.import("resource://gre/modules/FileUtils.jsm");
 Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://gre/modules/NetUtil.jsm");
 Components.utils.import("resource://gre/modules/Promise.jsm");
 Components.utils.import("resource://gre/modules/Task.jsm");
 Components.utils.import("resource://gre/modules/osfile.jsm");
 
@@ -440,23 +440,23 @@ function shutdownManager() {
   // Load the add-ons list as it was after application shutdown
   loadAddonsList();
 
   // Clear any crash report annotations
   gAppInfo.annotations = {};
 
   // Force the XPIProvider provider to reload to better
   // simulate real-world usage.
-  let XPIscope = Components.utils.import("resource://gre/modules/XPIProvider.jsm");
+  let XPIscope = Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm");
   // This would be cleaner if I could get it as the rejection reason from
   // the AddonManagerInternal.shutdown() promise
   gXPISaveError = XPIscope.XPIProvider._shutdownError;
   do_print("gXPISaveError set to: " + gXPISaveError);
   AddonManagerPrivate.unregisterProvider(XPIscope.XPIProvider);
-  Components.utils.unload("resource://gre/modules/XPIProvider.jsm");
+  Components.utils.unload("resource://gre/modules/addons/XPIProvider.jsm");
 }
 
 function loadAddonsList() {
   function readDirectories(aSection) {
     var dirs = [];
     var keys = parser.getKeys(aSection);
     while (keys.hasMore()) {
       let descriptor = parser.getString(aSection, keys.getNext());
--- a/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Tests AddonRepository.jsm
 
-Components.utils.import("resource://gre/modules/AddonRepository.jsm");
+Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm");
 
 Components.utils.import("resource://testing-common/httpd.js");
 var gServer = new HttpServer();
 gServer.start(-1);
 
 const PREF_GETADDONS_BROWSEADDONS        = "extensions.getAddons.browseAddons";
 const PREF_GETADDONS_BROWSERECOMMENDED   = "extensions.getAddons.recommended.browseURL";
 const PREF_GETADDONS_GETRECOMMENDED      = "extensions.getAddons.recommended.url";
--- a/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Tests caching in AddonRepository.jsm
 
-Components.utils.import("resource://gre/modules/AddonRepository.jsm");
+Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm");
 
 Components.utils.import("resource://testing-common/httpd.js");
 let gServer;
 
 const PORT      = 4444;
 const BASE_URL  = "http://localhost:" + PORT;
 
 const PREF_GETADDONS_CACHE_ENABLED = "extensions.getAddons.cache.enabled";
--- a/toolkit/mozapps/extensions/test/xpcshell/test_XPIcancel.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_XPIcancel.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Test the cancellable doing/done/cancelAll API in XPIProvider
 
-let scope = Components.utils.import("resource://gre/modules/XPIProvider.jsm");
+let scope = Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm");
 let XPIProvider = scope.XPIProvider;
 
 function run_test() {
   // Check that cancelling with nothing in progress doesn't blow up
   XPIProvider.cancelAll();
 
   // Check that a basic object gets cancelled
   let getsCancelled = {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug424262.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug424262.js
@@ -1,13 +1,13 @@
 /* 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/.
  */
-Components.utils.import("resource://gre/modules/AddonRepository.jsm");
+Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm");
 
 const PREF_GETADDONS_GETRECOMMENDED = "extensions.getAddons.recommended.url";
 
 Components.utils.import("resource://testing-common/httpd.js");
 var server;
 var RESULTS = [
   null,
   null,
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug554133.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug554133.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This verifies that if the AMO response provides total_results,
 // searchSucceeded is called with the correct number of total results
 
-Components.utils.import("resource://gre/modules/AddonRepository.jsm");
+Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm");
 
 const PREF_GETADDONS_GETSEARCHRESULTS = "extensions.getAddons.search.url";
 
 Components.utils.import("resource://testing-common/httpd.js");
 var server;
 
 var TESTS = [
 {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_no_addons.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_no_addons.js
@@ -3,17 +3,17 @@
  */
 
 // Test startup and restart when no add-ons are installed
 // bug 944006
 
 Components.utils.import("resource://gre/modules/Promise.jsm");
 
 // Load XPI Provider to get schema version ID
-let XPIScope = Components.utils.import("resource://gre/modules/XPIProvider.jsm");
+let XPIScope = Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm");
 const DB_SCHEMA = XPIScope.DB_SCHEMA;
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
 function run_test() {
   // Kick off the task-based tests...
   run_next_test();
 }
--- a/toolkit/mozapps/extensions/test/xpcshell/test_pluginchange.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_pluginchange.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 const LIST_UPDATED_TOPIC     = "plugins-list-updated";
 
 // We need to use the same algorithm for generating IDs for plugins
-var { getIDHashForString } = Components.utils.import("resource://gre/modules/PluginProvider.jsm");
+var { getIDHashForString } = Components.utils.import("resource://gre/modules/addons/PluginProvider.jsm");
 
 function PluginTag(name, description) {
   this.name = name;
   this.description = description;
 }
 
 PluginTag.prototype = {
   name: null,
--- a/toolkit/mozapps/extensions/test/xpcshell/test_syncGUID.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_syncGUID.js
@@ -2,17 +2,17 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 Components.utils.import("resource://gre/modules/Services.jsm");
 
 // restartManager() mucks with XPIProvider.jsm importing, so we hack around.
 this.__defineGetter__("XPIProvider", function () {
   let scope = {};
-  return Components.utils.import("resource://gre/modules/XPIProvider.jsm", scope)
+  return Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm", scope)
                    .XPIProvider;
 });
 
 const addonId = "addon1@tests.mozilla.org";
 
 function run_test() {
   Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_updatecheck.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_updatecheck.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This verifies that AddonUpdateChecker works correctly
 
-Components.utils.import("resource://gre/modules/AddonUpdateChecker.jsm");
+Components.utils.import("resource://gre/modules/addons/AddonUpdateChecker.jsm");
 
 Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
   // Create and configure the HTTP server.