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:
OverSu 2026-09-30 23:13:03 +02:00
commit b38dea0597
25901 changed files with 9982925 additions and 369 deletions

View file

@ -0,0 +1,121 @@
/* global Marionette, assert */
(function(module, ns) {
'use strict';
function DeviceInteraction(exampleCmds, subject) {
var commands = exampleCmds;
var expectedResponse;
setup(function() {
expectedResponse = null;
});
function driver() {
if (subject().client) {
return subject().client.driver;
}
return subject().driver;
}
return {
commandCallback: function commandCallback(error, value) {
commandCallback.error = error;
commandCallback.value = value;
},
withProtocol: function(version) {
setup(function() {
subject().protocol = version;
});
return this;
},
issues: function issues() {
var args = Array.prototype.slice.call(arguments),
cmd = args.shift(),
result,
commandCallback = this.commandCallback;
setup(function() {
if (!subject()) {
throw new Error('DeviceInteraction must be provided a subject');
}
args.push(commandCallback);
if (!(cmd in subject())) {
throw new Error('client does not have method ' + cmd);
}
result = subject()[cmd].apply(subject(), args);
});
test('should be chainable', function() {
assert.strictEqual(result, subject());
});
return this;
},
shouldSend: function shouldSend(options) {
var check = function(option, value) {
test('should send ' + option, function() {
var sent = driver().sent[0];
if (!(option in sent)) {
throw new Error(
option + ' was never sent as part of command to server');
}
assert.deepEqual(sent[option], value);
});
};
for (var key in options) {
if (options.hasOwnProperty(key)) {
check(key, options[key]);
}
}
return this;
},
serverResponds: function serverResponds(type, options) {
setup(function() {
if (!(type in commands)) {
throw new Error('No such example command: ' + type);
}
expectedResponse = commands[type](options);
driver().respond(expectedResponse);
});
return this;
},
callbackReceives: function callbackReceives(key) {
var commandCallback = this.commandCallback;
if (key) {
test('should receive ' + key + ' in response', function() {
if (typeof expectedResponse[key] == 'undefined') {
throw new Error(key + ' should not be undefined ' +
'for test mocks use a real value');
}
assert.strictEqual(commandCallback.value, expectedResponse[key]);
});
} else {
test('should receive whole body response', function() {
assert.strictEqual(commandCallback.value, expectedResponse);
});
}
return this;
}
};
}
module.exports = DeviceInteraction;
}.apply(
this,
(this.Marionette) ?
[Marionette('support/device-interaction'), Marionette] :
[module, require('../../lib/marionette/marionette')]
));

View file

@ -0,0 +1,45 @@
/* global Marionette */
(function(module) {
'use strict';
function FakeXhr() {
this.openArgs = null;
this.sendArgs = null;
this.headers = {};
this.responseHeaders = {};
}
FakeXhr.prototype = {
open: function() {
this.openArgs = arguments;
},
getResponseHeader: function(key) {
return this.responseHeaders[key];
},
setRequestHeader: function(key, value) {
this.headers[key] = value;
},
send: function() {
this.sendArgs = arguments;
},
respond: function(data, code) {
this.readyState = 4;
this.responseHeaders['content-type'] = 'application/json';
this.responseText = JSON.stringify(data);
this.status = code || 200;
this.onreadystatechange();
}
};
module.exports = FakeXhr;
}.apply(
this,
(this.Marionette) ?
[Marionette('support/fake-xhr'), Marionette] :
[module, require('../../lib/marionette/marionette')]
));

View file

@ -0,0 +1,43 @@
/* global Marionette */
(function(module) {
'use strict';
function MockDriver() {
this.sent = [];
this.queue = [];
this.timeout = 0;
}
MockDriver.prototype = {
connectionId: 0,
setScriptTimeout: function(timeout) {
this.timeout = timeout;
},
reset: function() {
this.sent.length = 0;
this.queue.length = 0;
},
send: function(cmd, cb) {
this.sent.push(cmd);
this.queue.push(cb);
},
respond: function(cmd) {
if (this.queue.length) {
(this.queue.shift())(cmd);
}
}
};
module.exports = MockDriver;
}.apply(
this,
(this.Marionette) ?
[Marionette('support/mock-driver'), Marionette] :
[module, require('../../lib/marionette/marionette')]
));

View file

@ -0,0 +1,45 @@
/* global Marionette */
/**
@namespace
*/
(function(module, ns) {
'use strict';
var Responder = ns.require('responder');
function FakeSocket() {
Responder.call(this);
FakeSocket.sockets.push(this);
this.destroyed = false;
if(arguments.length === 2) {
this.host = arguments[0];
this.port = arguments[1];
}
}
FakeSocket.sockets = [];
FakeSocket.prototype = Object.create(Responder.prototype);
FakeSocket.prototype.connect = function(port, host, cb) {
this.port = port;
this.host = host;
cb && cb();
};
FakeSocket.prototype.destroy = function() {
this.destroyed = true;
};
FakeSocket.prototype.close = FakeSocket.prototype.destroy;
module.exports = exports = FakeSocket;
}.apply(
this,
(this.Marionette) ?
[Marionette('support/socket'), Marionette] :
[module, require('../../lib/marionette/marionette')]
));