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
39
gaia/apps/system/fxa/test/marionette/lib/server.js
Executable file
39
gaia/apps/system/fxa/test/marionette/lib/server.js
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
'use strict';
|
||||
|
||||
function Server(child) {
|
||||
this.child = child;
|
||||
}
|
||||
|
||||
Server.prototype = {
|
||||
/**
|
||||
* Sends signal to stop child process and stop server.
|
||||
*
|
||||
* TODO: Bug 1056186:
|
||||
* [FxA] Create unit tests for Firefox Accounts mock server process
|
||||
*/
|
||||
stop: function() {
|
||||
this.child.kill('SIGTERM');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Spawn the child process where the FxA mock server lives.
|
||||
*
|
||||
* @param args - [ host, port, path ]
|
||||
* @param callback
|
||||
*/
|
||||
function create(args, callback) {
|
||||
var child = require('child_process')
|
||||
.fork(__dirname + '/server_mock_fxa.js', args)
|
||||
.on('message', function(data) {
|
||||
if (Array.isArray(data) && data[0] === 'start') {
|
||||
callback(null, new Server(child));
|
||||
}
|
||||
})
|
||||
.on('error', function (err) {
|
||||
callback(err);
|
||||
});
|
||||
}
|
||||
|
||||
Server.create = create;
|
||||
module.exports = Server;
|
||||
Loading…
Reference in a new issue