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,27 @@
'use strict';
/* jshint node: true, mocha: true */
/* global suiteSetup */
var helper = require('helper');
suite('Download tests', function() {
suiteSetup(helper.cleanupWorkspace);
teardown(helper.cleanupWorkspace);
test('APP=download make', function(done) {
helper.exec('APP=download make', function(error, stdout, stderr) {
helper.checkError(error, stdout, stderr);
var zipPath = process.cwd() +
'/profile/webapps/download.gaiamobile.org/application.zip';
var checkList = ['manifest.webapp'];
checkList.forEach(function(filePath) {
helper.checkFilePathInZip(zipPath, filePath);
});
done();
});
});
});

View file

@ -0,0 +1,165 @@
'use strict';
/* global MockL10n, loadBodyHTML, DownloadStore, downloadPicker,
DownloadFormatter, MockMozIntl */
/* global require, requireApp, suite, suiteTeardown, suiteSetup, test, assert,
MocksHelper, sinon */
require('/shared/test/unit/load_body_html_helper.js');
require('/shared/js/download/download_store.js');
require('/shared/js/download/download_formatter.js');
require('/shared/test/unit/mocks/mock_navigator_moz_set_message_handler.js');
require('/shared/test/unit/mocks/mock_l10n.js');
require('/shared/test/unit/mocks/mock_moz_intl.js');
require('/shared/test/unit/mocks/mock_lazy_loader.js');
var mocksHelperForDownloadPicker = new MocksHelper([
'LazyLoader'
]).init();
suite('pick.js >', function() {
var realSetMessageHandler = null;
var realL10n = null;
var realMozIntl = null;
var downloads = [];
function createSource(name, type) {
return {
name: name,
data: {
type: type
}
};
}
function runActivity(data) {
navigator.mozSetMessageHandler.mMessageHandlers.activity(data);
}
mocksHelperForDownloadPicker.attachTestHelpers();
suiteSetup(function(done) {
realL10n = navigator.mozL10n;
navigator.mozL10n = MockL10n;
realMozIntl = window.mozIntl;
window.mozIntl = MockMozIntl;
realSetMessageHandler = navigator.mozSetMessageHandler;
navigator.mozSetMessageHandler = window.MockNavigatormozSetMessageHandler;
navigator.mozSetMessageHandler.mSetup();
loadBodyHTML('/pick.html');
sinon.stub(DownloadStore, 'getAll', function() {
return {
set onsuccess(cb) {
cb({ target: { result: downloads }});
}
};
});
requireApp('download/js/pick.js', done);
});
suiteTeardown(function() {
navigator.mozL10n = realL10n;
navigator.mozSetMessageHandler.mTeardown();
navigator.mozSetMessageHandler = realSetMessageHandler;
window.mozIntl = realMozIntl;
DownloadStore.getAll.restore();
});
suite('Initialization >', function() {
test(' download picker ready ', function() {
var handlers = navigator.mozSetMessageHandler.mMessageHandlers;
assert.equal(Object.keys(handlers).length, 1);
assert.isFunction(handlers.activity);
});
});
suite('No downloads >', function() {
test(' document.body.dataset.downloads is 0', function() {
runActivity({
source: createSource('pick', 'application/*')
});
assert.equal(document.body.dataset.downloads, 0);
});
});
suite('Downloads >', function() {
suiteSetup(function() {
downloads = [
{
id: '1',
startTime: new Date(),
path: '/music.mp3'
}, {
id: '2',
startTime: new Date(),
path: '/image.gif'
}
];
runActivity({
source: createSource('pick', 'application/*')
});
});
suiteTeardown(function() {
downloadPicker.pick.restore();
});
function checkItem(download) {
var item = downloadPicker.list.querySelector('li[data-id="' +
download.id + '"]');
assert.equal(item.querySelector('.fileName').textContent,
DownloadFormatter.getFileName(download));
}
test(' rendered list', function() {
assert.equal(document.body.dataset.downloads, downloads.length);
assert.equal(downloadPicker.list.querySelectorAll('li').length,
downloads.length);
checkItem(downloads[0]);
checkItem(downloads[1]);
});
test(' click an item', function() {
var expectedDownload = downloads[0];
sinon.stub(downloadPicker, 'pick', function(download) {
assert.equal(download, expectedDownload);
return {};
});
var item = downloadPicker.list.querySelector('li[data-id="' +
expectedDownload.id + '"]');
item.click();
});
});
suite('Cancel action >', function() {
test(' clicking on cross icon', function() {
runActivity({
source: createSource('pick', 'application/*'),
postError: function(result) {
assert.equal(result, 'cancelled');
}
});
downloadPicker.header.dispatchEvent(new CustomEvent('action'));
});
});
suite('Error >', function() {
test(' name not supported', function() {
// "share" activities are not supported
runActivity({
source: createSource('share', 'application/*'),
postError: function(result) {
assert.equal(result, 'name not supported');
}
});
});
});
});

View file

@ -0,0 +1,4 @@
'use strict';
/* global require */
require('/shared/test/unit/mocks/mocks_helper.js');