forked from mirrors/gecko-dev
Bug 1371065: Part 0 - Fix unit tests that use the SDK loader :/ r=Mossop
MozReview-Commit-ID: 4ewrbY0FS09 --HG-- extra : rebase_source : 390256a9eb0d303d8582c24d69fff189b0e0ab4d
This commit is contained in:
parent
90d4e89eb3
commit
f829523282
6 changed files with 11 additions and 79 deletions
|
|
@ -13,18 +13,6 @@ do_get_profile(); // fxa needs a profile directory for storage.
|
||||||
// Load mocking/stubbing library, sinon
|
// Load mocking/stubbing library, sinon
|
||||||
// docs: http://sinonjs.org/releases/v2.3.2/
|
// docs: http://sinonjs.org/releases/v2.3.2/
|
||||||
Cu.import("resource://gre/modules/Timer.jsm");
|
Cu.import("resource://gre/modules/Timer.jsm");
|
||||||
const {Loader} = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {});
|
Services.scriptloader.loadSubScript("resource://testing-common/sinon-2.3.2.js", this);
|
||||||
const loader = new Loader.Loader({
|
/* globals sinon */
|
||||||
paths: {
|
|
||||||
"": "resource://testing-common/",
|
|
||||||
},
|
|
||||||
globals: {
|
|
||||||
setTimeout,
|
|
||||||
setInterval,
|
|
||||||
clearTimeout,
|
|
||||||
clearInterval,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const require = Loader.Require(loader, {id: ""});
|
|
||||||
const sinon = require("sinon-2.3.2");
|
|
||||||
// ================================================
|
// ================================================
|
||||||
|
|
|
||||||
|
|
@ -29,20 +29,8 @@ do_get_profile();
|
||||||
// Load mocking/stubbing library, sinon
|
// Load mocking/stubbing library, sinon
|
||||||
// docs: http://sinonjs.org/releases/v2.3.2/
|
// docs: http://sinonjs.org/releases/v2.3.2/
|
||||||
Cu.import("resource://gre/modules/Timer.jsm");
|
Cu.import("resource://gre/modules/Timer.jsm");
|
||||||
var {Loader} = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {});
|
Services.scriptloader.loadSubScript("resource://testing-common/sinon-2.3.2.js", this);
|
||||||
var loader = new Loader.Loader({
|
/* globals sinon */
|
||||||
paths: {
|
|
||||||
"": "resource://testing-common/",
|
|
||||||
},
|
|
||||||
globals: {
|
|
||||||
setTimeout,
|
|
||||||
setInterval,
|
|
||||||
clearTimeout,
|
|
||||||
clearInterval,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
var require = Loader.Require(loader, {id: ""});
|
|
||||||
var sinon = require("sinon-2.3.2");
|
|
||||||
// ================================================
|
// ================================================
|
||||||
|
|
||||||
// Load our bootstrap extension manifest so we can access our chrome/resource URIs.
|
// Load our bootstrap extension manifest so we can access our chrome/resource URIs.
|
||||||
|
|
|
||||||
|
|
@ -25,18 +25,6 @@ Components.manager.addBootstrappedManifestLocation(extensionDir);
|
||||||
// docs: http://sinonjs.org/releases/v2.3.2/
|
// docs: http://sinonjs.org/releases/v2.3.2/
|
||||||
/* exported sinon */
|
/* exported sinon */
|
||||||
Cu.import("resource://gre/modules/Timer.jsm");
|
Cu.import("resource://gre/modules/Timer.jsm");
|
||||||
const {Loader} = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {});
|
Services.scriptloader.loadSubScript("resource://testing-common/sinon-2.3.2.js", this);
|
||||||
const loader = new Loader.Loader({
|
/* globals sinon */
|
||||||
paths: {
|
|
||||||
"": "resource://testing-common/",
|
|
||||||
},
|
|
||||||
globals: {
|
|
||||||
setTimeout,
|
|
||||||
setInterval,
|
|
||||||
clearTimeout,
|
|
||||||
clearInterval,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const require = Loader.Require(loader, {id: ""});
|
|
||||||
this.sinon = require("sinon-2.3.2");
|
|
||||||
// ================================================
|
// ================================================
|
||||||
|
|
|
||||||
|
|
@ -24,18 +24,6 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||||
// Load mocking/stubbing library, sinon
|
// Load mocking/stubbing library, sinon
|
||||||
// docs: http://sinonjs.org/releases/v2.3.2/
|
// docs: http://sinonjs.org/releases/v2.3.2/
|
||||||
Cu.import("resource://gre/modules/Timer.jsm");
|
Cu.import("resource://gre/modules/Timer.jsm");
|
||||||
var {Loader} = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {});
|
Services.scriptloader.loadSubScript("resource://testing-common/sinon-2.3.2.js", this);
|
||||||
var loader = new Loader.Loader({
|
/* globals sinon */
|
||||||
paths: {
|
|
||||||
"": "resource://testing-common/",
|
|
||||||
},
|
|
||||||
globals: {
|
|
||||||
setTimeout,
|
|
||||||
setInterval,
|
|
||||||
clearTimeout,
|
|
||||||
clearInterval,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
var require = Loader.Require(loader, {id: ""});
|
|
||||||
var sinon = require("sinon-2.3.2");
|
|
||||||
// ================================================
|
// ================================================
|
||||||
|
|
|
||||||
|
|
@ -30,20 +30,8 @@ add_task(async function head_setup() {
|
||||||
// Load mocking/stubbing library, sinon
|
// Load mocking/stubbing library, sinon
|
||||||
// docs: http://sinonjs.org/releases/v2.3.2/
|
// docs: http://sinonjs.org/releases/v2.3.2/
|
||||||
Cu.import("resource://gre/modules/Timer.jsm");
|
Cu.import("resource://gre/modules/Timer.jsm");
|
||||||
var {Loader} = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {});
|
Services.scriptloader.loadSubScript("resource://testing-common/sinon-2.3.2.js", this);
|
||||||
var loader = new Loader.Loader({
|
/* globals sinon */
|
||||||
paths: {
|
|
||||||
"": "resource://testing-common/",
|
|
||||||
},
|
|
||||||
globals: {
|
|
||||||
setTimeout,
|
|
||||||
setInterval,
|
|
||||||
clearTimeout,
|
|
||||||
clearInterval,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
var require = Loader.Require(loader, {id: ""});
|
|
||||||
var sinon = require("sinon-2.3.2");
|
|
||||||
// ================================================
|
// ================================================
|
||||||
|
|
||||||
XPCOMUtils.defineLazyGetter(this, "SyncPingSchema", function() {
|
XPCOMUtils.defineLazyGetter(this, "SyncPingSchema", function() {
|
||||||
|
|
|
||||||
10
testing/mochitest/bootstrap.js
vendored
10
testing/mochitest/bootstrap.js
vendored
|
|
@ -50,15 +50,7 @@ function loadMochitest(e) {
|
||||||
WindowListener.setupWindow(win);
|
WindowListener.setupWindow(win);
|
||||||
Services.wm.addListener(WindowListener);
|
Services.wm.addListener(WindowListener);
|
||||||
|
|
||||||
let overlay;
|
let overlay = "chrome://mochikit/content/browser-test-overlay.xul";
|
||||||
if (flavor == "jetpack-addon") {
|
|
||||||
overlay = "chrome://mochikit/content/jetpack-addon-overlay.xul";
|
|
||||||
} else if (flavor == "jetpack-package") {
|
|
||||||
overlay = "chrome://mochikit/content/jetpack-package-overlay.xul";
|
|
||||||
} else {
|
|
||||||
overlay = "chrome://mochikit/content/browser-test-overlay.xul";
|
|
||||||
}
|
|
||||||
|
|
||||||
win.document.loadOverlay(overlay, null);
|
win.document.loadOverlay(overlay, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue