Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
66
gaia/shared/test/integration/marionette_loader.js
Executable file
66
gaia/shared/test/integration/marionette_loader.js
Executable file
|
|
@ -0,0 +1,66 @@
|
|||
'use strict';
|
||||
|
||||
var MockManager = require('./manager_mock.js');
|
||||
|
||||
var COMMS_APPS = ['dialer', 'contacts'];
|
||||
/**
|
||||
* @param {Marionette.Client} client Marionette client to use.
|
||||
* @constructor
|
||||
*/
|
||||
function MarionetteLoader(client) {
|
||||
this.client = client;
|
||||
}
|
||||
module.exports = MarionetteLoader;
|
||||
|
||||
|
||||
/**
|
||||
* Make a new helper.
|
||||
* @param {Marionette.Client} client Marionette client to use.
|
||||
* @param {Object} options Optional map of attributes for Apps.
|
||||
* @return {Apps} instance.
|
||||
*/
|
||||
MarionetteLoader.setup = function(client, options) {
|
||||
return new MarionetteLoader(client);
|
||||
};
|
||||
|
||||
|
||||
MarionetteLoader.prototype = {
|
||||
/**
|
||||
* @type {Marionette.Client}
|
||||
*/
|
||||
client: null,
|
||||
|
||||
/**
|
||||
* Includes the main entry point for an application.
|
||||
* @param {String} app
|
||||
* @param {String} region
|
||||
* @param {String} [baseFolder=apps] base folder of app.
|
||||
*/
|
||||
getAppClass: function(app, region, baseFolder) {
|
||||
region = region || app;
|
||||
app = COMMS_APPS.indexOf(app) === -1 ? app : 'communications/' + app;
|
||||
baseFolder = baseFolder || 'apps';
|
||||
var AppClass = require(
|
||||
__dirname + '/../../../' +
|
||||
baseFolder + '/' + app + '/test/marionette/lib/' + region);
|
||||
return new AppClass(this.client);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns an instance of MockManager that will look into the given app and the
|
||||
* shared folder.
|
||||
* @param {String} app
|
||||
*/
|
||||
getMockManager: function(app) {
|
||||
return new MockManager(this.client, app);
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets the marionette-client Actions class and instantiates it.
|
||||
* @param {String} helper.
|
||||
*/
|
||||
getActions: function() {
|
||||
var Actions = require('marionette-client').Actions;
|
||||
return new Actions(this.client);
|
||||
}
|
||||
};
|
||||
Loading…
Reference in a new issue