Bug 793928: Switch users of the promise library to the new location and move tests files. r=gavin
authorDave Townsend <dtownsend@oxymoronical.com>
Fri, 01 Feb 2013 11:43:15 -0800
changeset 122171 fb6692f7e52183f619a64896aa0968116e7d7640
parent 122170 729d655f29f6fe09bd65ba1fe861b1051da480d4
child 122173 0e7e657e773934b8ef0d02539f07a141b46790ff
push idunknown
push userunknown
push dateunknown
reviewersgavin
bugs793928
milestone21.0a1
Bug 793928: Switch users of the promise library to the new location and move tests files. r=gavin
addon-sdk/test/Makefile.in
addon-sdk/test/unit/head.js
addon-sdk/test/unit/test_promise.js
addon-sdk/test/unit/xpcshell.ini
browser/components/places/tests/browser/head.js
browser/components/sessionstore/src/SessionStore.jsm
browser/components/sessionstore/src/_SessionFile.jsm
browser/components/sessionstore/src/nsSessionStartup.js
browser/devtools/commandline/gcli.jsm
browser/devtools/commandline/test/head.js
browser/devtools/debugger/DebuggerPanel.jsm
browser/devtools/framework/Sidebar.jsm
browser/devtools/framework/Target.jsm
browser/devtools/framework/Toolbox.jsm
browser/devtools/framework/ToolboxHosts.jsm
browser/devtools/framework/gDevTools.jsm
browser/devtools/framework/test/head.js
browser/devtools/inspector/InspectorPanel.jsm
browser/devtools/profiler/ProfilerPanel.jsm
browser/devtools/shared/test/browser_templater_basic.js
browser/devtools/styleeditor/StyleEditorPanel.jsm
browser/devtools/webconsole/HUDService.jsm
browser/devtools/webconsole/webconsole.js
browser/modules/test/unit/test_newtab-migrate-v1.js
mobile/android/chrome/content/WebAppRT.js
netwerk/test/unit/test_backgroundfilesaver.js
services/common/bagheeraclient.js
services/datareporting/policy.jsm
services/datareporting/tests/xpcshell/test_session_recorder.js
services/healthreport/healthreporter.jsm
services/healthreport/modules-testing/utils.jsm
services/healthreport/profile.jsm
services/healthreport/providers.jsm
services/healthreport/tests/xpcshell/test_healthreporter.js
services/healthreport/tests/xpcshell/test_profile.js
services/healthreport/tests/xpcshell/test_provider_sessions.js
services/metrics/collector.jsm
services/metrics/dataprovider.jsm
services/metrics/modules-testing/mocks.jsm
services/metrics/storage.jsm
services/metrics/tests/xpcshell/test_metrics_storage.js
services/sync/tests/unit/test_corrupt_keys.js
testing/xpcshell/selftest.py
testing/xpcshell/xpcshell.ini
toolkit/Makefile.in
toolkit/addon-sdk/Makefile.in
toolkit/addon-sdk/loader.js
toolkit/addon-sdk/promise/Makefile.in
toolkit/addon-sdk/promise/core.js
toolkit/addon-sdk/test/Makefile.in
toolkit/addon-sdk/test/unit/head.js
toolkit/addon-sdk/test/unit/test_promise.js
toolkit/addon-sdk/test/unit/xpcshell.ini
toolkit/components/downloads/test/unit/head_download_manager.js
toolkit/components/jsdownloads/src/DownloadCore.jsm
toolkit/components/jsdownloads/test/unit/head.js
toolkit/components/osfile/_PromiseWorker.jsm
toolkit/components/osfile/osfile_async_front.jsm
toolkit/components/osfile/tests/mochi/main_test_osfile_async.js
toolkit/components/places/BookmarkHTMLUtils.jsm
toolkit/components/places/tests/browser/head.js
toolkit/components/places/tests/head_common.js
toolkit/components/search/nsSearchService.js
toolkit/content/Task.jsm
toolkit/content/tests/unit/test_task.js
toolkit/devtools/debugger/server/dbg-server.js
toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
toolkit/modules/Sqlite.jsm
toolkit/modules/tests/xpcshell/test_sqlite.js
rename from toolkit/addon-sdk/test/Makefile.in
rename to addon-sdk/test/Makefile.in
rename from toolkit/addon-sdk/test/unit/head.js
rename to addon-sdk/test/unit/head.js
--- a/toolkit/addon-sdk/test/unit/head.js
+++ b/addon-sdk/test/unit/head.js
@@ -1,13 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 
-Components.utils.import("resource://gre/modules/commonjs/promise/core.js");
+Components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 
 let run_promise_tests = function run_promise_tests(tests, cb) {
   let timer = Components.classes["@mozilla.org/timer;1"]
      .createInstance(Components.interfaces.nsITimer);
   let loop = function loop(index) {
     if (index >= tests.length) {
       if (cb) {
         cb.call();
rename from toolkit/addon-sdk/test/unit/test_promise.js
rename to addon-sdk/test/unit/test_promise.js
rename from toolkit/addon-sdk/test/unit/xpcshell.ini
rename to addon-sdk/test/unit/xpcshell.ini
--- a/browser/components/places/tests/browser/head.js
+++ b/browser/components/places/tests/browser/head.js
@@ -138,10 +138,10 @@ function addVisits(aPlaceInfo, aWindow, 
         if (aCallback)
           aCallback();
       }
     }
   );
 }
 
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-  "resource://gre/modules/commonjs/promise/core.js");
+  "resource://gre/modules/commonjs/sdk/core/promise.js");
 
--- a/browser/components/sessionstore/src/SessionStore.jsm
+++ b/browser/components/sessionstore/src/SessionStore.jsm
@@ -75,17 +75,17 @@ const TAB_EVENTS = [
 Cu.import("resource://gre/modules/Services.jsm", this);
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
 // debug.js adds NS_ASSERT. cf. bug 669196
 Cu.import("resource://gre/modules/debug.js", this);
 Cu.import("resource:///modules/TelemetryTimestamps.jsm", this);
 Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", this);
 Cu.import("resource://gre/modules/osfile.jsm", this);
 Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm", this);
-Cu.import("resource://gre/modules/commonjs/promise/core.js", this);
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", this);
 
 XPCOMUtils.defineLazyServiceGetter(this, "gSessionStartup",
   "@mozilla.org/browser/sessionstartup;1", "nsISessionStartup");
 
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ScratchpadManager",
   "resource:///modules/devtools/scratchpad-manager.jsm");
--- a/browser/components/sessionstore/src/_SessionFile.jsm
+++ b/browser/components/sessionstore/src/_SessionFile.jsm
@@ -27,17 +27,17 @@ this.EXPORTED_SYMBOLS = ["_SessionFile"]
 
 const Cu = Components.utils;
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 
 XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
   "resource://gre/modules/TelemetryStopwatch.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
--- a/browser/components/sessionstore/src/nsSessionStartup.js
+++ b/browser/components/sessionstore/src/nsSessionStartup.js
@@ -34,17 +34,17 @@
 const Cc = Components.classes;
 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/TelemetryStopwatch.jsm");
 Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 
 XPCOMUtils.defineLazyModuleGetter(this, "_SessionFile",
   "resource:///modules/sessionstore/_SessionFile.jsm");
 
 const STATE_RUNNING_STR = "running";
 
 function debug(aMsg) {
   aMsg = ("SessionStartup: " + aMsg).replace(/\S{80}/g, "$&\n");
--- a/browser/devtools/commandline/gcli.jsm
+++ b/browser/devtools/commandline/gcli.jsm
@@ -6972,17 +6972,17 @@ exports.createExecutionContext = functio
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 define('gcli/promise', ['require', 'exports', 'module' ], function(require, exports, module) {
 
   var imported = {};
-  Components.utils.import("resource://gre/modules/commonjs/promise/core.js",
+  Components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js",
                           imported);
 
   exports.defer = imported.Promise.defer;
   exports.resolve = imported.Promise.resolve;
   exports.reject = imported.Promise.reject;
 
 });
 define("text!gcli/ui/intro.html", [], "\n" +
--- a/browser/devtools/commandline/test/head.js
+++ b/browser/devtools/commandline/test/head.js
@@ -14,17 +14,17 @@ let console = (function() {
 let TargetFactory = (function() {
   let tempScope = {};
   Components.utils.import("resource:///modules/devtools/Target.jsm", tempScope);
   return tempScope.TargetFactory;
 })();
 
 let Promise = (function() {
   let tempScope = {};
-  Components.utils.import("resource://gre/modules/commonjs/promise/core.js", tempScope);
+  Components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js", tempScope);
   return tempScope.Promise;
 })();
 
 // Import the GCLI test helper
 let testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
 
 Services.scriptloader.loadSubScript(testDir + "/helpers.js", this);
 Services.scriptloader.loadSubScript(testDir + "/mockCommands.js", this);
--- a/browser/devtools/debugger/DebuggerPanel.jsm
+++ b/browser/devtools/debugger/DebuggerPanel.jsm
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 this.EXPORTED_SYMBOLS = ["DebuggerPanel"];
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource:///modules/devtools/EventEmitter.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "DebuggerServer",
   "resource://gre/modules/devtools/dbg-server.jsm");
 
 function DebuggerPanel(iframeWindow, toolbox) {
   this.panelWin = iframeWindow;
   this._toolbox = toolbox;
--- a/browser/devtools/framework/Sidebar.jsm
+++ b/browser/devtools/framework/Sidebar.jsm
@@ -3,17 +3,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/. */
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 this.EXPORTED_SYMBOLS = ["ToolSidebar"];
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource:///modules/devtools/EventEmitter.jsm");
 
 const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
 /**
  * ToolSidebar provides methods to register tabs in the sidebar.
  * It's assumed that the sidebar contains a xul:tabbox.
  *
--- a/browser/devtools/framework/Target.jsm
+++ b/browser/devtools/framework/Target.jsm
@@ -4,17 +4,17 @@
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = [ "TargetFactory" ];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource:///modules/devtools/EventEmitter.jsm");
 
 
 const targets = new WeakMap();
 
 /**
  * Functions for creating Targets
  */
--- a/browser/devtools/framework/Toolbox.jsm
+++ b/browser/devtools/framework/Toolbox.jsm
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 Cu.import('resource://gre/modules/XPCOMUtils.jsm');
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource:///modules/devtools/EventEmitter.jsm");
 Cu.import("resource:///modules/devtools/gDevTools.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Hosts",
                                   "resource:///modules/devtools/ToolboxHosts.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "CommandUtils",
                                   "resource:///modules/devtools/DeveloperToolbar.jsm");
 
--- a/browser/devtools/framework/ToolboxHosts.jsm
+++ b/browser/devtools/framework/ToolboxHosts.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/. */
 
 "use strict";
 
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource:///modules/devtools/EventEmitter.jsm");
 
 this.EXPORTED_SYMBOLS = [ "Hosts" ];
 
 /**
  * A toolbox host represents an object that contains a toolbox (e.g. the
  * sidebar or a separate window). Any host object should implement the
  * following functions:
--- a/browser/devtools/framework/gDevTools.jsm
+++ b/browser/devtools/framework/gDevTools.jsm
@@ -5,17 +5,17 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = [ "gDevTools", "DevTools", "gDevToolsBrowser" ];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource:///modules/devtools/EventEmitter.jsm");
 Cu.import("resource:///modules/devtools/ToolDefinitions.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Toolbox",
   "resource:///modules/devtools/Toolbox.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory",
   "resource:///modules/devtools/Target.jsm");
 
 const FORBIDDEN_IDS = new Set("toolbox", "");
--- a/browser/devtools/framework/test/head.js
+++ b/browser/devtools/framework/test/head.js
@@ -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/. */
 
 let tempScope = {};
 Components.utils.import("resource:///modules/devtools/Target.jsm", tempScope);
 let TargetFactory = tempScope.TargetFactory;
 Components.utils.import("resource://gre/modules/devtools/Console.jsm", tempScope);
 let console = tempScope.console;
-Components.utils.import("resource://gre/modules/commonjs/promise/core.js", tempScope);
+Components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js", tempScope);
 let Promise = tempScope.Promise;
 
 /**
  * Open a new tab at a URL and call a callback on load
  */
 function addTab(aURL, aCallback)
 {
   waitForExplicitFinish();
--- a/browser/devtools/inspector/InspectorPanel.jsm
+++ b/browser/devtools/inspector/InspectorPanel.jsm
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 this.EXPORTED_SYMBOLS = ["InspectorPanel"];
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource:///modules/devtools/EventEmitter.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "MarkupView",
   "resource:///modules/devtools/MarkupView.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Selection",
   "resource:///modules/devtools/Selection.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "HTMLBreadcrumbs",
   "resource:///modules/devtools/Breadcrumbs.jsm");
--- a/browser/devtools/profiler/ProfilerPanel.jsm
+++ b/browser/devtools/profiler/ProfilerPanel.jsm
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const Cu = Components.utils;
 
 Cu.import("resource:///modules/devtools/ProfilerController.jsm");
 Cu.import("resource:///modules/devtools/ProfilerHelpers.jsm");
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource:///modules/devtools/EventEmitter.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 this.EXPORTED_SYMBOLS = ["ProfilerPanel"];
 
 XPCOMUtils.defineLazyGetter(this, "DebuggerServer", function () {
   Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
   return DebuggerServer;
--- a/browser/devtools/shared/test/browser_templater_basic.js
+++ b/browser/devtools/shared/test/browser_templater_basic.js
@@ -6,17 +6,17 @@
 /*
  * These tests run both in Mozilla/Mochitest and plain browsers (as does
  * domtemplate)
  * We should endevour to keep the source in sync.
  */
 
 var imports = {};
 Cu.import("resource:///modules/devtools/Templater.jsm", imports);
-Cu.import("resource://gre/modules/commonjs/promise/core.js", imports);
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", imports);
 
 function test() {
   addTab("http://example.com/browser/browser/devtools/shared/test/browser_templater_basic.html", function() {
     info("Starting DOM Templater Tests");
     runTest(0);
   });
 }
 
--- a/browser/devtools/styleeditor/StyleEditorPanel.jsm
+++ b/browser/devtools/styleeditor/StyleEditorPanel.jsm
@@ -4,17 +4,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/. */
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 this.EXPORTED_SYMBOLS = ["StyleEditorPanel"];
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource:///modules/devtools/EventEmitter.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "StyleEditorChrome",
                         "resource:///modules/devtools/StyleEditorChrome.jsm");
 
 this.StyleEditorPanel = function StyleEditorPanel(panelWin, toolbox) {
   EventEmitter.decorate(this);
 
--- a/browser/devtools/webconsole/HUDService.jsm
+++ b/browser/devtools/webconsole/HUDService.jsm
@@ -22,17 +22,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
     "resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "WebConsoleUtils",
     "resource://gre/modules/devtools/WebConsoleUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-    "resource://gre/modules/commonjs/promise/core.js");
+    "resource://gre/modules/commonjs/sdk/core/promise.js");
 
 const STRINGS_URI = "chrome://browser/locale/devtools/webconsole.properties";
 let l10n = new WebConsoleUtils.l10n(STRINGS_URI);
 
 this.EXPORTED_SYMBOLS = ["HUDService"];
 
 ///////////////////////////////////////////////////////////////////////////
 //// The HUD service
--- a/browser/devtools/webconsole/webconsole.js
+++ b/browser/devtools/webconsole/webconsole.js
@@ -39,17 +39,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 
 XPCOMUtils.defineLazyModuleGetter(this, "AutocompletePopup",
                                   "resource:///modules/AutocompletePopup.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "WebConsoleUtils",
                                   "resource://gre/modules/devtools/WebConsoleUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-                                  "resource://gre/modules/commonjs/promise/core.js");
+                                  "resource://gre/modules/commonjs/sdk/core/promise.js");
 
 const STRINGS_URI = "chrome://browser/locale/devtools/webconsole.properties";
 let l10n = new WebConsoleUtils.l10n(STRINGS_URI);
 
 
 // The XUL namespace.
 const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
--- a/browser/modules/test/unit/test_newtab-migrate-v1.js
+++ b/browser/modules/test/unit/test_newtab-migrate-v1.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 Cu.import("resource:///modules/NewTabUtils.jsm");
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://gre/modules/Services.jsm");
 
 /**
  * Asynchronously load test data from chromeappstore.sqlite.
  *
  * @param aDBFile
  *        the database file to load
  * @return {Promise} resolved when the load is complete
--- a/mobile/android/chrome/content/WebAppRT.js
+++ b/mobile/android/chrome/content/WebAppRT.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 let Cc = Components.classes;
 let Ci = Components.interfaces;
 let Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/FileUtils.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 
 function pref(name, value) {
   return {
     name: name,
     value: value
   }
 }
 
--- a/netwerk/test/unit/test_backgroundfilesaver.js
+++ b/netwerk/test/unit/test_backgroundfilesaver.js
@@ -17,17 +17,17 @@ const Cr = Components.results;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-                                  "resource://gre/modules/commonjs/promise/core.js");
+                                  "resource://gre/modules/commonjs/sdk/core/promise.js");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
 const BackgroundFileSaverOutputStream = Components.Constructor(
       "@mozilla.org/network/background-file-saver;1?mode=outputstream",
       "nsIBackgroundFileSaver");
 
 const BackgroundFileSaverStreamListener = Components.Constructor(
--- a/services/common/bagheeraclient.js
+++ b/services/common/bagheeraclient.js
@@ -18,17 +18,17 @@ this.EXPORTED_SYMBOLS = [
   "BagheeraClientRequestResult",
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://services-common/rest.js");
 #endif
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 
 
 /**
  * Represents the result of a Bagheera request.
  */
 this.BagheeraClientRequestResult = function BagheeraClientRequestResult() {
--- a/services/datareporting/policy.jsm
+++ b/services/datareporting/policy.jsm
@@ -21,17 +21,17 @@ this.EXPORTED_SYMBOLS = [
   "DataSubmissionRequest", // For test use only.
   "DataReportingPolicy",
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 #endif
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 
 const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
 
 // Used as a sanity lower bound for dates stored in prefs. This module was
 // implemented in 2012, so any earlier dates indicate an incorrect clock.
 const OLDEST_ALLOWED_YEAR = 2012;
--- a/services/datareporting/tests/xpcshell/test_session_recorder.js
+++ b/services/datareporting/tests/xpcshell/test_session_recorder.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const {utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://gre/modules/services/datareporting/sessions.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://services-common/utils.js");
 
 
 function run_test() {
   run_next_test();
 }
--- a/services/healthreport/healthreporter.jsm
+++ b/services/healthreport/healthreporter.jsm
@@ -15,17 +15,17 @@ const MILLISECONDS_PER_DAY = 24 * 60 * 6
 Cu.import("resource://gre/modules/Metrics.jsm");
 Cu.import("resource://services-common/bagheeraclient.js");
 Cu.import("resource://services-common/async.js");
 #endif
 
 Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/preferences.js");
 Cu.import("resource://services-common/utils.js");
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://gre/modules/osfile.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 
 // Oldest year to allow in date preferences. This module was implemented in
 // 2012 and no dates older than that should be encountered.
--- a/services/healthreport/modules-testing/utils.jsm
+++ b/services/healthreport/modules-testing/utils.jsm
@@ -10,17 +10,17 @@ this.EXPORTED_SYMBOLS = [
   "makeFakeAppDir",
   "createFakeCrash",
   "InspectedHealthReporter",
 ];
 
 
 const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://gre/modules/FileUtils.jsm");
 Cu.import("resource://gre/modules/osfile.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/services-common/utils.js");
 Cu.import("resource://gre/modules/HealthReport.jsm");
 
 
 let APP_INFO = {
--- a/services/healthreport/profile.jsm
+++ b/services/healthreport/profile.jsm
@@ -17,17 +17,17 @@ const MILLISECONDS_PER_DAY = 24 * 60 * 6
 
 Cu.import("resource://gre/modules/Metrics.jsm");
 
 #endif
 
 const DEFAULT_PROFILE_MEASUREMENT_NAME = "age";
 const REQUIRED_UINT32_TYPE = {type: "TYPE_UINT32"};
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://gre/modules/osfile.jsm")
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 
 // Profile creation time access.
 // This is separate from the provider to simplify testing and enable extraction
 // to a shared location in the future.
--- a/services/healthreport/providers.jsm
+++ b/services/healthreport/providers.jsm
@@ -26,17 +26,17 @@ this.EXPORTED_SYMBOLS = [
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/Metrics.jsm");
 
 #endif
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://gre/modules/osfile.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://services-common/preferences.js");
 Cu.import("resource://services-common/utils.js");
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
--- a/services/healthreport/tests/xpcshell/test_healthreporter.js
+++ b/services/healthreport/tests/xpcshell/test_healthreporter.js
@@ -2,17 +2,17 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://services-common/observers.js");
 Cu.import("resource://services-common/preferences.js");
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://gre/modules/services/healthreport/healthreporter.jsm");
 Cu.import("resource://gre/modules/services/datareporting/policy.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://testing-common/services-common/bagheeraserver.js");
 Cu.import("resource://testing-common/services/metrics/mocks.jsm");
 Cu.import("resource://testing-common/services/healthreport/utils.jsm");
 
--- a/services/healthreport/tests/xpcshell/test_profile.js
+++ b/services/healthreport/tests/xpcshell/test_profile.js
@@ -7,17 +7,17 @@ const {utils: Cu} = Components;
 
 const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
 
 // Create profile directory before use.
 // It can be no older than a day ago….
 let profile_creation_lower = Date.now() - MILLISECONDS_PER_DAY;
 do_get_profile();
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://gre/modules/Metrics.jsm");
 Cu.import("resource://gre/modules/services/healthreport/profile.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 
 
 function MockProfileMetadataProvider(name="MockProfileMetadataProvider") {
   this.name = name;
   ProfileMetadataProvider.call(this);
--- a/services/healthreport/tests/xpcshell/test_provider_sessions.js
+++ b/services/healthreport/tests/xpcshell/test_provider_sessions.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const {utils: Cu} = Components;
 
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://gre/modules/Metrics.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://gre/modules/services-common/utils.js");
 Cu.import("resource://gre/modules/services/datareporting/sessions.jsm");
 Cu.import("resource://gre/modules/services/healthreport/providers.jsm");
 
 
 function run_test() {
--- a/services/metrics/collector.jsm
+++ b/services/metrics/collector.jsm
@@ -7,17 +7,17 @@
 #ifndef MERGED_COMPARTMENT
 this.EXPORTED_SYMBOLS = ["Collector"];
 
 const {utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/services/metrics/dataprovider.jsm");
 #endif
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 
 
 /**
  * Handles and coordinates the collection of metrics data from providers.
  *
--- a/services/metrics/dataprovider.jsm
+++ b/services/metrics/dataprovider.jsm
@@ -12,17 +12,17 @@ this.EXPORTED_SYMBOLS = [
 ];
 
 const {utils: Cu} = Components;
 
 const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
 
 #endif
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/preferences.js");
 Cu.import("resource://services-common/utils.js");
 
 
 
 /**
--- a/services/metrics/modules-testing/mocks.jsm
+++ b/services/metrics/modules-testing/mocks.jsm
@@ -6,17 +6,17 @@
 
 this.EXPORTED_SYMBOLS = [
   "DummyMeasurement",
   "DummyProvider",
 ];
 
 const {utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://gre/modules/Metrics.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 
 this.DummyMeasurement = function DummyMeasurement(name="DummyMeasurement") {
   this.name = name;
 
   Metrics.Measurement.call(this);
 }
--- a/services/metrics/storage.jsm
+++ b/services/metrics/storage.jsm
@@ -14,17 +14,17 @@ this.EXPORTED_SYMBOLS = [
 ];
 
 const {utils: Cu} = Components;
 
 const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
 
 #endif
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://gre/modules/Sqlite.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 
 
 // These do not account for leap seconds. Meh.
 function dateToDays(date) {
--- a/services/metrics/tests/xpcshell/test_metrics_storage.js
+++ b/services/metrics/tests/xpcshell/test_metrics_storage.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const {utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://gre/modules/Metrics.jsm");
 Cu.import("resource://services-common/utils.js");
 
 
 const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
 
 
 function run_test() {
--- a/services/sync/tests/unit/test_corrupt_keys.js
+++ b/services/sync/tests/unit/test_corrupt_keys.js
@@ -6,17 +6,17 @@ Cu.import("resource://services-sync/cons
 Cu.import("resource://services-sync/engines.js");
 Cu.import("resource://services-sync/engines/tabs.js");
 Cu.import("resource://services-sync/engines/history.js");
 Cu.import("resource://services-sync/record.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/status.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://testing-common/services/sync/utils.js");
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 
 add_task(function test_locally_changed_keys() {
   let passphrase = "abcdeabcdeabcdeabcdeabcdea";
 
   let hmacErrorCount = 0;
   function counting(f) {
     return function() {
       hmacErrorCount++;
--- a/testing/xpcshell/selftest.py
+++ b/testing/xpcshell/selftest.py
@@ -33,52 +33,52 @@ function run_test() { run_next_test(); }
 
 add_test(function test_failing() {
   do_check_true(false);
   run_next_test();
 });
 '''
 
 ADD_TASK_SINGLE = '''
-Components.utils.import("resource://gre/modules/commonjs/promise/core.js");
+Components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 
 function run_test() { run_next_test(); }
 
 add_task(function test_task() {
   yield Promise.resolve(true);
   yield Promise.resolve(false);
 });
 '''
 
 ADD_TASK_MULTIPLE = '''
-Components.utils.import("resource://gre/modules/commonjs/promise/core.js");
+Components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 
 function run_test() { run_next_test(); }
 
 add_task(function test_task() {
   yield Promise.resolve(true);
 });
 
 add_task(function test_2() {
   yield Promise.resolve(true);
 });
 '''
 
 ADD_TASK_REJECTED = '''
-Components.utils.import("resource://gre/modules/commonjs/promise/core.js");
+Components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 
 function run_test() { run_next_test(); }
 
 add_task(function test_failing() {
   yield Promise.reject(new Error("I fail."));
 });
 '''
 
 ADD_TASK_FAILURE_INSIDE = '''
-Components.utils.import("resource://gre/modules/commonjs/promise/core.js");
+Components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 
 function run_test() { run_next_test(); }
 
 add_task(function test() {
   let result = yield Promise.resolve(false);
 
   do_check_true(result);
 });
--- a/testing/xpcshell/xpcshell.ini
+++ b/testing/xpcshell/xpcshell.ini
@@ -132,17 +132,16 @@ skip-if = os == "win" || os == "mac" || 
 [include:content/base/test/unit_ipc/xpcshell.ini]
 [include:chrome/test/unit_ipc/xpcshell.ini]
 [include:extensions/cookie/test/unit_ipc/xpcshell.ini]
 [include:ipc/testshell/tests/xpcshell.ini]
 [include:modules/libpref/test/unit_ipc/xpcshell.ini]
 [include:netwerk/test/unit_ipc/xpcshell.ini]
 [include:netwerk/cookie/test/unit_ipc/xpcshell.ini]
 [include:toolkit/components/contentprefs/tests/unit_ipc/xpcshell.ini]
-[include:toolkit/addon-sdk/test/unit/xpcshell.ini]
 [include:addon-sdk/test/unit/xpcshell.ini]
 [include:uriloader/exthandler/tests/unit_ipc/xpcshell.ini]
 
 [include:modules/libmar/tests/unit/xpcshell.ini]
 skip-if = os == "android"
 
 [include:b2g/components/test/unit/xpcshell.ini]
 
--- a/toolkit/Makefile.in
+++ b/toolkit/Makefile.in
@@ -5,17 +5,16 @@
 DEPTH     = @DEPTH@
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 PARALLEL_DIRS = \
-  addon-sdk \
   components \
   content \
   devtools \
   forgetaboutsite \
   identity \
   locales \
   modules \
   mozapps/downloads \
deleted file mode 100644
--- a/toolkit/addon-sdk/Makefile.in
+++ /dev/null
@@ -1,25 +0,0 @@
-# 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/.
-
-DEPTH     = @DEPTH@
-topsrcdir = @top_srcdir@
-srcdir    = @srcdir@
-VPATH     = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-include $(topsrcdir)/config/config.mk
-
-DIRS += \
-  promise \
-  $(NULL)
-
-JS_MODULES_PATH := $(FINAL_TARGET)/modules/commonjs
-
-EXTRA_JS_MODULES := \
-  loader.js \
-  $(NULL)
-
-TEST_DIRS += test
-
-include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/toolkit/addon-sdk/loader.js
+++ /dev/null
@@ -1,390 +0,0 @@
-/* vim:set ts=2 sw=2 sts=2 expandtab */
-/* 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/.
- */
-;(function(id, factory) { // Module boilerplate :(
-  if (typeof(define) === 'function') { // RequireJS
-    define(factory);
-  } else if (typeof(require) === 'function') { // CommonJS
-    factory.call(this, require, exports, module);
-  } else if (~String(this).indexOf('BackstagePass')) { // JSM
-    this[factory.name] = {};
-    factory(function require(uri) {
-      var imports = {};
-      this['Components'].utils.import(uri, imports);
-      return imports;
-    }, this[factory.name], { uri: __URI__, id: id });
-    this.EXPORTED_SYMBOLS = [factory.name];
-  } else {  // Browser or alike
-    var globals = this
-    factory(function require(id) {
-      return globals[id];
-    }, (globals[id] = {}), { uri: document.location.href + '#' + id, id: id });
-  }
-}).call(this, 'loader', function Loader(require, exports, module) {
-
-'use strict';
-
-const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu,
-        results: Cr, manager: Cm } = Components;
-const systemPrincipal = CC('@mozilla.org/systemprincipal;1', 'nsIPrincipal')();
-const { loadSubScript } = Cc['@mozilla.org/moz/jssubscript-loader;1'].
-                     getService(Ci.mozIJSSubScriptLoader);
-const { notifyObservers } = Cc['@mozilla.org/observer-service;1'].
-                        getService(Ci.nsIObserverService);
-
-// Define some shortcuts.
-const bind = Function.call.bind(Function.bind);
-const getOwnPropertyNames = Object.getOwnPropertyNames;
-const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
-const define = Object.defineProperties;
-const prototypeOf = Object.getPrototypeOf;
-const create = Object.create;
-const keys = Object.keys;
-
-// Workaround for bug 674195. Freezing objects from other compartments fail,
-// so we use `Object.freeze` from the same component instead.
-function freeze(object) {
-  if (prototypeOf(object) === null) {
-      Object.freeze(object);
-  }
-  else {
-    prototypeOf(prototypeOf(object.isPrototypeOf)).
-      constructor. // `Object` from the owner compartment.
-      freeze(object);
-  }
-  return object;
-}
-
-// Returns map of given `object`-s own property descriptors.
-const descriptor = iced(function descriptor(object) {
-  let value = {};
-  getOwnPropertyNames(object).forEach(function(name) {
-    value[name] = getOwnPropertyDescriptor(object, name)
-  });
-  return value;
-});
-exports.descriptor = descriptor;
-
-// Freeze important built-ins so they can't be used by untrusted code as a
-// message passing channel.
-freeze(Object);
-freeze(Object.prototype);
-freeze(Function);
-freeze(Function.prototype);
-freeze(Array);
-freeze(Array.prototype);
-freeze(String);
-freeze(String.prototype);
-
-// This function takes `f` function sets it's `prototype` to undefined and
-// freezes it. We need to do this kind of deep freeze with all the exposed
-// functions so that untrusted code won't be able to use them a message
-// passing channel.
-function iced(f) {
-  f.prototype = undefined;
-  return freeze(f);
-}
-
-// Defines own properties of given `properties` object on the given
-// target object overriding any existing property with a conflicting name.
-// Returns `target` object. Note we only export this function because it's
-// useful during loader bootstrap when other util modules can't be used &
-// thats only case where this export should be used.
-const override = iced(function override(target, source) {
-  let properties = descriptor(target)
-  let extension = descriptor(source || {})
-  getOwnPropertyNames(extension).forEach(function(name) {
-    properties[name] = extension[name];
-  });
-  return define({}, properties);
-});
-exports.override = override;
-
-// Function takes set of options and returns a JS sandbox. Function may be
-// passed set of options:
-//  - `name`: A string value which identifies the sandbox in about:memory. Will
-//    throw exception if omitted.
-// - `principal`: String URI or `nsIPrincipal` for the sandbox. Defaults to
-//    system principal.
-// - `prototype`: Ancestor for the sandbox that will be created. Defaults to
-//    `{}`.
-// - `wantXrays`: A Boolean value indicating whether code outside the sandbox
-//    wants X-ray vision with respect to objects inside the sandbox. Defaults
-//    to `true`.
-// - `sandbox`: A sandbox to share JS compartment with. If omitted new
-//    compartment will be created.
-// For more details see:
-// https://developer.mozilla.org/en/Components.utils.Sandbox
-const Sandbox = iced(function Sandbox(options) {
-  // Normalize options and rename to match `Cu.Sandbox` expectations.
-  options = {
-    // Do not expose `Components` if you really need them (bad idea!) you
-    // still can expose via prototype.
-    wantComponents: false,
-    sandboxName: options.name,
-    principal: 'principal' in options ? options.principal : systemPrincipal,
-    wantXrays: 'wantXrays' in options ? options.wantXrays : true,
-    sandboxPrototype: 'prototype' in options ? options.prototype : {},
-    sameGroupAs: 'sandbox' in options ? options.sandbox : null
-  };
-
-  // Make `options.sameGroupAs` only if `sandbox` property is passed,
-  // otherwise `Cu.Sandbox` will throw.
-  if (!options.sameGroupAs)
-    delete options.sameGroupAs;
-
-  let sandbox = Cu.Sandbox(options.principal, options);
-
-  // Each sandbox at creation gets set of own properties that will be shadowing
-  // ones from it's prototype. We override delete such `sandbox` properties
-  // to avoid shadowing.
-  delete sandbox.Iterator;
-  delete sandbox.Components;
-  delete sandbox.importFunction;
-  delete sandbox.debug;
-
-  return sandbox;
-});
-exports.Sandbox = Sandbox;
-
-// Evaluates code from the given `uri` into given `sandbox`. If
-// `options.source` is passed, then that code is evaluated instead.
-// Optionally following options may be given:
-// - `options.encoding`: Source encoding, defaults to 'UTF-8'.
-// - `options.line`: Line number to start count from for stack traces.
-//    Defaults to 1.
-// - `options.version`: Version of JS used, defaults to '1.8'.
-const evaluate = iced(function evaluate(sandbox, uri, options) {
-  let { source, line, version, encoding } = override({
-    encoding: 'UTF-8',
-    line: 1,
-    version: '1.8',
-    source: null
-  }, options);
-
-  return source ? Cu.evalInSandbox(source, sandbox, version, uri, line)
-                : loadSubScript(uri, sandbox, encoding);
-});
-exports.evaluate = evaluate;
-
-// Populates `exports` of the given CommonJS `module` object, in the context
-// of the given `loader` by evaluating code associated with it.
-const load = iced(function load(loader, module) {
-  let { sandboxes, globals } = loader;
-  let require = Require(loader, module);
-
-  let sandbox = sandboxes[module.uri] = Sandbox({
-    name: module.uri,
-    // Get an existing module sandbox, if any, so we can reuse its compartment
-    // when creating the new one to reduce memory consumption.
-    sandbox: sandboxes[keys(sandboxes).shift()],
-    // We expose set of properties defined by `CommonJS` specification via
-    // prototype of the sandbox. Also globals are deeper in the prototype
-    // chain so that each module has access to them as well.
-    prototype: create(globals, descriptor({
-      require: require,
-      module: module,
-      exports: module.exports
-    })),
-    wantXrays: false
-  });
-
-  evaluate(sandbox, module.uri);
-
-  if (module.exports && typeof(module.exports) === 'object')
-    freeze(module.exports);
-
-  return module;
-});
-exports.load = load;
-
-// Utility function to check if id is relative.
-function isRelative(id) { return id[0] === '.'; }
-// Utility function to normalize module `uri`s so they have `.js` extension.
-function normalize(uri) { return uri.substr(-3) === '.js' ? uri : uri + '.js'; }
-// Utility function to join paths. In common case `base` is a
-// `requirer.uri` but in some cases it may be `baseURI`. In order to
-// avoid complexity we require `baseURI` with a trailing `/`.
-const resolve = iced(function resolve(id, base) {
-  let paths = id.split('/');
-  let result = base.split('/');
-  result.pop();
-  while (paths.length) {
-    let path = paths.shift();
-    if (path === '..')
-      result.pop();
-    else if (path !== '.')
-      result.push(path);
-  }
-  return result.join('/');
-});
-exports.resolve = resolve;
-
-const resolveURI = iced(function resolveURI(id, mapping) {
-  let count = mapping.length, index = 0;
-  while (index < count) {
-    let [ path, uri ] = mapping[index ++];
-    if (id.indexOf(path) === 0)
-      return normalize(id.replace(path, uri));
-  }
-});
-exports.resolveURI = resolveURI;
-
-// Creates version of `require` that will be exposed to the given `module`
-// in the context of the given `loader`. Each module gets own limited copy
-// of `require` that is allowed to load only a modules that are associated
-// with it during link time.
-const Require = iced(function Require(loader, requirer) {
-  let { modules, mapping, resolve } = loader;
-
-  function require(id) {
-    if (!id) // Throw if `id` is not passed.
-      throw Error('you must provide a module name when calling require() from '
-                  + requirer.id, requirer.uri);
-
-    // Resolve `id` to its requirer if it's relative.
-    let requirement = requirer ? resolve(id, requirer.id) : id;
-
-
-    // Resolves `uri` of module using loaders resolve function.
-    let uri = resolveURI(requirement, mapping);
-
-
-    if (!uri) // Throw if `uri` can not be resolved.
-      throw Error('Module: Can not resolve "' + id + '" module required by ' +
-                  requirer.id + ' located at ' + requirer.uri, requirer.uri);
-
-    let module = null;
-    // If module is already cached by loader then just use it.
-    if (uri in modules) {
-      module = modules[uri];
-    }
-    // Otherwise load and cache it. We also freeze module to prevent it from
-    // further changes at runtime.
-    else {
-      module = modules[uri] = Module(requirement, uri);
-      freeze(load(loader, module));
-    }
-
-    return module.exports;
-  }
-  // Make `require.main === module` evaluate to true in main module scope.
-  require.main = loader.main === requirer ? requirer : undefined;
-  return iced(require);
-});
-exports.Require = Require;
-
-const main = iced(function main(loader, id) {
-  let module = Module(id, resolveURI(id, loader.mapping));
-  loader.main = module;
-  return load(loader, module).exports;
-});
-exports.main = main;
-
-// Makes module object that is made available to CommonJS modules when they
-// are evaluated, along with `exports` and `require`.
-const Module = iced(function Module(id, uri) {
-  return create(null, {
-    id: { enumerable: true, value: id },
-    exports: { enumerable: true, writable: true, value: create(null) },
-    uri: { value: uri }
-  });
-});
-exports.Module = Module;
-
-// Takes `loader`, and unload `reason` string and notifies all observers that
-// they should cleanup after them-self.
-const unload = iced(function unload(loader, reason) {
-  // subject is a unique object created per loader instance.
-  // This allows any code to cleanup on loader unload regardless of how
-  // it was loaded. To handle unload for specific loader subject may be
-  // asserted against loader.destructor or require('@loader/unload')
-  // Note: We don not destroy loader's module cache or sandboxes map as
-  // some modules may do cleanup in subsequent turns of event loop. Destroying
-  // cache may cause module identity problems in such cases.
-  let subject = { wrappedJSObject: loader.destructor };
-  notifyObservers(subject, 'sdk:loader:destroy', reason);
-});
-exports.unload = unload;
-
-// Function makes new loader that can be used to load CommonJS modules
-// described by a given `options.manifest`. Loader takes following options:
-// - `globals`: Optional map of globals, that all module scopes will inherit
-//   from. Map is also exposed under `globals` property of the returned loader
-//   so it can be extended further later. Defaults to `{}`.
-// - `modules` Optional map of built-in module exports mapped by module id.
-//   These modules will incorporated into module cache. Each module will be
-//   frozen.
-// - `resolve` Optional module `id` resolution function. If given it will be
-//   used to resolve module URIs, by calling it with require term, requirer
-//   module object (that has `uri` property) and `baseURI` of the loader.
-//   If `resolve` does not returns `uri` string exception will be thrown by
-//   an associated `require` call.
-const Loader = iced(function Loader(options) {
-  let { modules, globals, resolve, paths } = override({
-    paths: {},
-    modules: {},
-    globals: {},
-    resolve: exports.resolve
-  }, options);
-
-  // We create an identity object that will be dispatched on an unload
-  // event as subject. This way unload listeners will be able to assert
-  // which loader is unloaded. Please note that we intentionally don't
-  // use `loader` as subject to prevent a loader access leakage through
-  // observer notifications.
-  let destructor = freeze(create(null));
-
-  // Make mapping array that is sorted from longest path to shortest path
-  // to allow overlays.
-  let mapping = keys(paths).
-    sort(function(a, b) { return b.length - a.length }).
-    map(function(path) { return [ path, paths[path] ] });
-
-  // Define pseudo modules.
-  modules = override({
-    '@loader/unload': destructor,
-    '@loader/options': options,
-    'chrome': { Cc: Cc, Ci: Ci, Cu: Cu, Cr: Cr, Cm: Cm,
-                CC: bind(CC, Components), components: Components }
-  }, modules);
-
-  modules = keys(modules).reduce(function(result, id) {
-    // We resolve `uri` from `id` since modules are cached by `uri`.
-    let uri = resolveURI(id, mapping);
-    let module = Module(id, uri);
-    module.exports = freeze(modules[id]);
-    result[uri] = freeze(module);
-    return result;
-  }, {});
-
-  // Loader object is just a representation of a environment
-  // state. We freeze it and mark make it's properties non-enumerable
-  // as they are pure implementation detail that no one should rely upon.
-  return freeze(create(null, {
-    destructor: { enumerable: false, value: destructor },
-    globals: { enumerable: false, value: globals },
-    mapping: { enumerable: false, value: mapping },
-    // Map of module objects indexed by module URIs.
-    modules: { enumerable: false, value: modules },
-    // Map of module sandboxes indexed by module URIs.
-    sandboxes: { enumerable: false, value: {} },
-    resolve: { enumerable: false, value: resolve },
-    // Main (entry point) module, it can be set only once, since loader
-    // instance can have only one main module.
-    main: new function() {
-      let main;
-      return {
-        enumerable: false,
-        get: function() { return main; },
-        // Only set main if it has not being set yet!
-        set: function(module) { main = main || module; }
-      }
-    }
-  }));
-});
-exports.Loader = Loader;
-
-});
deleted file mode 100644
--- a/toolkit/addon-sdk/promise/Makefile.in
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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/.
-
-DEPTH     = @DEPTH@
-topsrcdir = @top_srcdir@
-srcdir    = @srcdir@
-VPATH     = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-include $(topsrcdir)/config/config.mk
-
-JS_MODULES_PATH := $(FINAL_TARGET)/modules/commonjs/promise
-
-EXTRA_JS_MODULES := \
-  core.js \
-  $(NULL)
-
-include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/toolkit/addon-sdk/promise/core.js
+++ /dev/null
@@ -1,218 +0,0 @@
-/* vim:set ts=2 sw=2 sts=2 expandtab */
-/*jshint undef: true es5: true node: true browser: true devel: true
-         forin: true latedef: false */
-/*global define: true, Cu: true, __URI__: true */
-;(function(id, factory) { // Module boilerplate :(
-  if (typeof(define) === 'function') { // RequireJS
-    define(factory);
-  } else if (typeof(require) === 'function') { // CommonJS
-    factory.call(this, require, exports, module);
-  } else if (String(this).indexOf('BackstagePass') >= 0) { // JSM
-    this[factory.name] = {};
-    factory(function require(uri) {
-      var imports = {};
-      this['Components'].utils.import(uri, imports);
-      return imports;
-    }, this[factory.name], { uri: __URI__, id: id });
-    this.EXPORTED_SYMBOLS = [factory.name];
-  } else {  // Browser or alike
-    var globals = this;
-    factory(function require(id) {
-      return globals[id];
-    }, (globals[id] = {}), { uri: document.location.href + '#' + id, id: id });
-  }
-}).call(this, 'promise/core', function Promise(require, exports, module) {
-
-'use strict';
-
-/**
- * Internal utility: Wraps given `value` into simplified promise, successfully
- * fulfilled to a given `value`. Note the result is not a complete promise
- * implementation, as its method `then` does not returns anything.
- */
-function fulfilled(value) {
-  return { then: function then(fulfill) { fulfill(value); } };
-}
-
-/**
- * Internal utility: Wraps given input into simplified promise, pre-rejected
- * with a given `reason`. Note the result is not a complete promise
- * implementation, as its method `then` does not returns anything.
- */
-function rejected(reason) {
-  return { then: function then(fulfill, reject) { reject(reason); } };
-}
-
-/**
- * Internal utility: Decorates given `f` function, so that on exception promise
- * rejected with thrown error is returned.
- */
-function attempt(f) {
-  return function effort(input) {
-    try {
-      return f(input);
-    }
-    catch(error) {
-      return rejected(error);
-    }
-  };
-}
-
-/**
- * Internal utility: Returns `true` if given `value` is a promise. Value is
- * assumed to be a promise if it implements method `then`.
- */
-function isPromise(value) {
-  return value && typeof(value.then) === 'function';
-}
-
-/**
- * Creates deferred object containing fresh promise & methods to either resolve
- * or reject it. The result is an object with the following properties:
- * - `promise` Eventual value representation implementing CommonJS [Promises/A]
- *   (http://wiki.commonjs.org/wiki/Promises/A) API.
- * - `resolve` Single shot function that resolves enclosed `promise` with a
- *   given `value`.
- * - `reject` Single shot function that rejects enclosed `promise` with a given
- *   `reason`.
- *
- *  ## Example
- *
- *  function fetchURI(uri, type) {
- *    var deferred = defer();
- *    var request = new XMLHttpRequest();
- *    request.open("GET", uri, true);
- *    request.responseType = type;
- *    request.onload = function onload() {
- *      deferred.resolve(request.response);
- *    }
- *    request.onerror = function(event) {
- *     deferred.reject(event);
- *    }
- *    request.send();
- *
- *    return deferred.promise;
- *  }
- */
-function defer() {
-  // Define FIFO queue of observer pairs. Once promise is resolved & all queued
-  // observers are forwarded to `result` and variable is set to `null`.
-  var observers = [];
-
-  // Promise `result`, which will be assigned a resolution value once promise
-  // is resolved. Note that result will always be assigned promise (or alike)
-  // object to take care of propagation through promise chains. If result is
-  // `null` promise is not resolved yet.
-  var result = null;
-
-  var deferred = {
-    promise: {
-      then: function then(onFulfill, onError) {
-        var deferred = defer();
-
-        // Decorate `onFulfill` / `onError` handlers with `attempt`, that
-        // way if wrapped handler throws exception decorator will catch and
-        // return promise rejected with it, which will cause rejection of
-        // `deferred.promise`. If handler is missing, substitute it with an
-        // utility function that takes one argument and returns promise
-        // fulfilled / rejected with it. This takes care of propagation
-        // through the rest of the promise chain.
-        onFulfill = onFulfill ? attempt(onFulfill) : fulfilled;
-        onError = onError ? attempt(onError) : rejected;
-
-        // Create a pair of observers that invoke given handlers & propagate
-        // results to `deferred.promise`.
-        function resolveDeferred(value) { deferred.resolve(onFulfill(value)); }
-        function rejectDeferred(reason) { deferred.resolve(onError(reason)); }
-
-        // If enclosed promise (`this.promise`) observers queue is still alive
-        // enqueue a new observer pair into it. Note that this does not
-        // necessary means that promise is pending, it may already be resolved,
-        // but we still have to queue observers to guarantee an order of
-        // propagation.
-        if (observers) {
-          observers.push({ resolve: resolveDeferred, reject: rejectDeferred });
-        }
-        // Otherwise just forward observer pair right to a `result` promise.
-        else {
-          result.then(resolveDeferred, rejectDeferred);
-        }
-
-        return deferred.promise;
-      }
-    },
-    /**
-     * Resolves associated `promise` to a given `value`, unless it's already
-     * resolved or rejected. Note that resolved promise is not necessary a
-     * successfully fulfilled. Promise may be resolved with a promise `value`
-     * in which case `value` promise's fulfillment / rejection will propagate
-     * up to a promise resolved with `value`.
-     */
-    resolve: function resolve(value) {
-      if (!result) {
-        // Store resolution `value` in a `result` as a promise, so that all
-        // the subsequent handlers can be simply forwarded to it. Since
-        // `result` will be a promise all the value / error propagation will
-        // be uniformly taken care of.
-        result = isPromise(value) ? value : fulfilled(value);
-
-        // Forward already registered observers to a `result` promise in the
-        // order they were registered. Note that we intentionally dequeue
-        // observer at a time until queue is exhausted. This makes sure that
-        // handlers registered as side effect of observer forwarding are
-        // queued instead of being invoked immediately, guaranteeing FIFO
-        // order.
-        while (observers.length) {
-          var observer = observers.shift();
-          result.then(observer.resolve, observer.reject);
-        }
-
-        // Once `observers` queue is exhausted we `null`-ify it, so that
-        // new handlers are forwarded straight to the `result`.
-        observers = null;
-      }
-    },
-    /**
-     * Rejects associated `promise` with a given `reason`, unless it's already
-     * resolved / rejected. This is just a (better performing) convenience
-     * shortcut for `deferred.resolve(reject(reason))`.
-     */
-    reject: function reject(reason) {
-      // Note that if promise is resolved that does not necessary means that it
-      // is successfully fulfilled. Resolution value may be a promise in which
-      // case its result propagates. In other words if promise `a` is resolved
-      // with promise `b`, `a` is either fulfilled or rejected depending
-      // on weather `b` is fulfilled or rejected. Here `deferred.promise` is
-      // resolved with a promise pre-rejected with a given `reason`, there for
-      // `deferred.promise` is rejected with a given `reason`. This may feel
-      // little awkward first, but doing it this way greatly simplifies
-      // propagation through promise chains.
-      deferred.resolve(rejected(reason));
-    }
-  };
-
-  return deferred;
-}
-exports.defer = defer;
-
-/**
- * Returns a promise resolved to a given `value`.
- */
-function resolve(value) {
-  var deferred = defer();
-  deferred.resolve(value);
-  return deferred.promise;
-}
-exports.resolve = resolve;
-
-/**
- * Returns a promise rejected with a given `reason`.
- */
-function reject(reason) {
-  var deferred = defer();
-  deferred.reject(reason);
-  return deferred.promise;
-}
-exports.reject = reject;
-
-});
--- a/toolkit/components/downloads/test/unit/head_download_manager.js
+++ b/toolkit/components/downloads/test/unit/head_download_manager.js
@@ -11,17 +11,17 @@ const Cr = Components.results;
 
 do_get_profile();
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://testing-common/httpd.js");
 Cu.import("resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-                                  "resource://gre/modules/commonjs/promise/core.js");
+                                  "resource://gre/modules/commonjs/sdk/core/promise.js");
 
 var downloadUtils = { };
 XPCOMUtils.defineLazyServiceGetter(downloadUtils,
                                    "downloadManager",
                                    "@mozilla.org/download-manager;1",
                                    Ci.nsIDownloadManager);
 
 function createURI(aObj)
--- a/toolkit/components/jsdownloads/src/DownloadCore.jsm
+++ b/toolkit/components/jsdownloads/src/DownloadCore.jsm
@@ -44,17 +44,17 @@ const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-                                  "resource://gre/modules/commonjs/promise/core.js");
+                                  "resource://gre/modules/commonjs/sdk/core/promise.js");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
 const BackgroundFileSaverStreamListener = Components.Constructor(
       "@mozilla.org/network/background-file-saver;1?mode=streamlistener",
       "nsIBackgroundFileSaver");
 
 ////////////////////////////////////////////////////////////////////////////////
--- a/toolkit/components/jsdownloads/test/unit/head.js
+++ b/toolkit/components/jsdownloads/test/unit/head.js
@@ -23,17 +23,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource://gre/modules/Downloads.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "HttpServer",
                                   "resource://testing-common/httpd.js");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-                                  "resource://gre/modules/commonjs/promise/core.js");
+                                  "resource://gre/modules/commonjs/sdk/core/promise.js");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
 const HTTP_SERVER_PORT = 4444;
 const HTTP_BASE = "http://localhost:" + HTTP_SERVER_PORT;
 
--- a/toolkit/components/osfile/_PromiseWorker.jsm
+++ b/toolkit/components/osfile/_PromiseWorker.jsm
@@ -5,17 +5,17 @@
  * Not for public use yet.
  */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["PromiseWorker"];
 
 // The library of promises.
-Components.utils.import("resource://gre/modules/commonjs/promise/core.js", this);
+Components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js", this);
 
 /**
  * An implementation of queues (FIFO).
  *
  * The current implementation uses one array, runs in O(n ^ 2), and is optimized
  * for the case in which queues are generally short.
  */
 let Queue = function Queue() {
--- a/toolkit/components/osfile/osfile_async_front.jsm
+++ b/toolkit/components/osfile/osfile_async_front.jsm
@@ -42,17 +42,17 @@ if (OS.Constants.Win) {
   Components.utils.import("resource://gre/modules/osfile/ospath_unix_back.jsm", this);
   OSError = OS.Shared.Unix.Error;
 } else {
   throw new Error("I am neither under Windows nor under a Posix system");
 }
 let Type = OS.Shared.Type;
 
 // The library of promises.
-Components.utils.import("resource://gre/modules/commonjs/promise/core.js", this);
+Components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js", this);
 
 // The implementation of communications
 Components.utils.import("resource://gre/modules/osfile/_PromiseWorker.jsm", this);
 
 // If profileDir is not available, osfile.jsm has been imported before the
 // profile is setup. In this case, we need to observe "profile-do-change"
 // and set OS.Constants.Path.profileDir as soon as it becomes available.
 if (!("profileDir" in OS.Constants.Path) || !("localProfileDir" in OS.Constants.Path)) {
--- a/toolkit/components/osfile/tests/mochi/main_test_osfile_async.js
+++ b/toolkit/components/osfile/tests/mochi/main_test_osfile_async.js
@@ -1,12 +1,12 @@
 "use strict";
 
 Components.utils.import("resource://gre/modules/osfile.jsm");
-Components.utils.import("resource://gre/modules/commonjs/promise/core.js");
+Components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Components.utils.import("resource://gre/modules/Task.jsm");
 
 // The following are used to compare against a well-tested reference
 // implementation of file I/O.
 Components.utils.import("resource://gre/modules/NetUtil.jsm");
 Components.utils.import("resource://gre/modules/FileUtils.jsm");
 Components.utils.import("resource://gre/modules/Services.jsm");
 
--- a/toolkit/components/places/BookmarkHTMLUtils.jsm
+++ b/toolkit/components/places/BookmarkHTMLUtils.jsm
@@ -62,17 +62,17 @@ const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
 Cu.import("resource://gre/modules/FileUtils.jsm");
 Cu.import("resource://gre/modules/PlacesUtils.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 
 const Container_Normal = 0;
 const Container_Toolbar = 1;
 const Container_Menu = 2;
 const Container_Unfiled = 3;
 const Container_Places = 4;
 
 const LOAD_IN_SIDEBAR_ANNO = "bookmarkProperties/loadInSidebar";
--- a/toolkit/components/places/tests/browser/head.js
+++ b/toolkit/components/places/tests/browser/head.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 const TRANSITION_LINK = Ci.nsINavHistoryService.TRANSITION_LINK;
 const TRANSITION_TYPED = Ci.nsINavHistoryService.TRANSITION_TYPED;
 
 Components.utils.import("resource://gre/modules/NetUtil.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-                                  "resource://gre/modules/commonjs/promise/core.js");
+                                  "resource://gre/modules/commonjs/sdk/core/promise.js");
 
 /**
  * Allows waiting for an observer notification once.
  *
  * @param aTopic
  *        Notification topic to observe.
  *
  * @return {Promise}
--- a/toolkit/components/places/tests/head_common.js
+++ b/toolkit/components/places/tests/head_common.js
@@ -23,17 +23,17 @@ const TITLE_LENGTH_MAX = 4096;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-                                  "resource://gre/modules/commonjs/promise/core.js");
+                                  "resource://gre/modules/commonjs/sdk/core/promise.js");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
 // This imports various other objects in addition to PlacesUtils.
 Cu.import("resource://gre/modules/PlacesUtils.jsm");
 
--- a/toolkit/components/search/nsSearchService.js
+++ b/toolkit/components/search/nsSearchService.js
@@ -3,17 +3,17 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cr = Components.results;
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/commonjs/promise/core.js");
+Components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Components.utils.import("resource://gre/modules/Deprecated.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask",
   "resource://gre/modules/DeferredTask.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
   "resource://gre/modules/Task.jsm");
--- a/toolkit/content/Task.jsm
+++ b/toolkit/content/Task.jsm
@@ -90,17 +90,17 @@ this.EXPORTED_SYMBOLS = [
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Task
 
 /**
  * This object provides the public module functions.
  */
 this.Task = {
--- a/toolkit/content/tests/unit/test_task.js
+++ b/toolkit/content/tests/unit/test_task.js
@@ -11,17 +11,17 @@
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-                                  "resource://gre/modules/commonjs/promise/core.js");
+                                  "resource://gre/modules/commonjs/sdk/core/promise.js");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
 /**
  * Returns a promise that will be resolved with the given value, when an event
  * posted on the event loop of the main thread is processed.
--- a/toolkit/devtools/debugger/server/dbg-server.js
+++ b/toolkit/devtools/debugger/server/dbg-server.js
@@ -19,17 +19,17 @@ const DBG_STRINGS_URI = "chrome://global
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 let wantLogging = Services.prefs.getBoolPref("devtools.debugger.log");
 
 Cu.import("resource://gre/modules/jsdebugger.jsm");
 addDebuggerToGlobal(this);
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 const { defer, resolve, reject } = Promise;
 
 function dumpn(str) {
   if (wantLogging) {
     dump("DBG-SERVER: " + str + "\n");
   }
 }
 
--- a/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
+++ b/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
@@ -13,17 +13,17 @@
 //// Globals
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/PlacesUtils.jsm");
 Cu.import("resource://gre/modules/ForgetAboutSite.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-                                  "resource://gre/modules/commonjs/promise/core.js");
+                                  "resource://gre/modules/commonjs/sdk/core/promise.js");
 
 const COOKIE_EXPIRY = Math.round(Date.now() / 1000) + 60;
 const COOKIE_NAME = "testcookie";
 const COOKIE_PATH = "/";
 
 const LOGIN_USERNAME = "username";
 const LOGIN_PASSWORD = "password";
 const LOGIN_USERNAME_FIELD = "username_field";
--- a/toolkit/modules/Sqlite.jsm
+++ b/toolkit/modules/Sqlite.jsm
@@ -5,17 +5,17 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = [
   "Sqlite",
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://gre/modules/osfile.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://services-common/log4moz.js");
 
 XPCOMUtils.defineLazyModuleGetter(this, "CommonUtils",
                                   "resource://services-common/utils.js");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
--- a/toolkit/modules/tests/xpcshell/test_sqlite.js
+++ b/toolkit/modules/tests/xpcshell/test_sqlite.js
@@ -2,17 +2,17 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 do_get_profile();
 
-Cu.import("resource://gre/modules/commonjs/promise/core.js");
+Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://gre/modules/osfile.jsm");
 Cu.import("resource://gre/modules/Sqlite.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 
 // To spin the event loop in test.
 Cu.import("resource://services-common/async.js");
 
 function sleep(ms) {