Bug 1082843. Don't import Promise.jsm into the global scope in xpcshell tests. r=yoric

This commit is contained in:
Boris Zbarsky 2014-10-15 00:42:54 -04:00
Родитель 3daa14b33f
Коммит 427f80e0de
4 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -8,6 +8,7 @@ Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Http.jsm");
Cu.import("resource://testing-common/httpd.js");
Cu.import("resource:///modules/loop/MozLoopService.jsm");
Cu.import("resource://gre/modules/Promise.jsm");
const { MozLoopServiceInternal } = Cu.import("resource:///modules/loop/MozLoopService.jsm", {});
XPCOMUtils.defineLazyModuleGetter(this, "MozLoopPushHandler",

Просмотреть файл

@ -5,6 +5,7 @@
const TEST_ORIGIN = "example.org";
const TEST_ORIGIN_2 = "example.com";
const TEST_PERMISSION = "test-permission";
Components.utils.import("resource://gre/modules/Promise.jsm");
function promiseTimeout(delay) {
let deferred = Promise.defer();

Просмотреть файл

@ -23,7 +23,7 @@ var _profileInitialized = false;
// modules.
_register_modules_protocol_handler();
let _Promise = Components.utils.import("resource://gre/modules/Promise.jsm", this).Promise;
let _Promise = Components.utils.import("resource://gre/modules/Promise.jsm", {}).Promise;
// Support a common assertion library, Assert.jsm.
let AssertCls = Components.utils.import("resource://testing-common/Assert.jsm", null).Assert;

Просмотреть файл

@ -13,6 +13,7 @@ Cu.import("resource://gre/modules/Sqlite.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/AsyncShutdown.jsm");
Cu.import("resource://gre/modules/Promise.jsm");
function getConnection(dbName, extraOptions={}) {
let path = dbName + ".sqlite";