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
33
gaia/tests/jsmarionette/runner/marionette-js-runner/test/fixtures/rpc.js
vendored
Executable file
33
gaia/tests/jsmarionette/runner/marionette-js-runner/test/fixtures/rpc.js
vendored
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
'use strict';
|
||||
var RPC = require('../../lib/rpc');
|
||||
var Promise = require('promise');
|
||||
|
||||
var rpc = new RPC(process.send.bind(process));
|
||||
|
||||
rpc.register('test', {
|
||||
$rpc: { methods: ['args'] },
|
||||
|
||||
getSelf: function() {
|
||||
return Promise.resolve(this);
|
||||
},
|
||||
|
||||
noArgs: function() {
|
||||
return Promise.resolve();
|
||||
},
|
||||
|
||||
args: function() {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
return new Promise(function(accept) {
|
||||
return accept(args);
|
||||
});
|
||||
},
|
||||
|
||||
error: function() {
|
||||
return new Promise(function() {
|
||||
throw new Error('xfoo');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var handle = rpc.handle();
|
||||
process.on('message', handle);
|
||||
Loading…
Reference in a new issue