helpers gains a method to setup a test controller
This commit is contained in:
Родитель
67c5bdb59e
Коммит
2053f5b95e
|
@ -13,6 +13,7 @@ Cu.import("resource://gre/modules/PlacesUtils.jsm");
|
|||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
|
||||
const {MICROS_PER_DAY} = require("DateUtils");
|
||||
const {Controller} = require("Controller");
|
||||
|
||||
let scriptLoader = Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader);
|
||||
|
||||
|
@ -157,4 +158,10 @@ exports.testUtils = {
|
|||
tsToDay: function(ts) {
|
||||
return Math.floor(ts / MICROS_PER_DAY);
|
||||
},
|
||||
|
||||
setupTestController: function(options={}) {
|
||||
options.storage = options.storage || {};
|
||||
let testController = new Controller(options);
|
||||
return testController;
|
||||
},
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче