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,112 @@
'use strict';
/**
* A Marionette test helper for app installation flow.
*/
/**
* @constructor
* @param {Marionette.Client} client Marionette client to use.
*/
function AppInstall(client) {
this.client = client.scope({ searchTimeout: 200000 });
}
module.exports = AppInstall;
AppInstall.prototype = {
_install: function(type, manifestURL) {
this.client.executeScript(function install(type, url) {
window.wrappedJSObject.navigator.mozApps[type](url);
}, [type, manifestURL]);
},
/**
* Install an app.
* @param {string} manifestURL The manifestURL of the app to be installed.
* @param {Object} [options] The options for installation.
*/
installPackage: function install(manifestURL) {
return this._install('installPackage', manifestURL);
},
/**
* Install an app.
* @param {string} manifestURL The manifestURL of the app to be installed.
* @param {Object} [options] The options for installation.
*/
install: function install(manifestURL) {
return this._install('install', manifestURL);
},
/**
* Uninstall an app.
* @param {string} [manifestURL] The manifestURL of the app.
*/
uninstall: function(manifestURL) {
this.client.switchToFrame();
this.client.executeAsyncScript(function uninstall(url) {
var win = window.wrappedJSObject;
var mgmt = win.navigator.mozApps.mgmt;
mgmt.getAll().onsuccess = function(e) {
var app = e.target.result.find(function(app) {
return app.manifestURL === url;
});
mgmt.uninstall(app);
marionetteScriptFinished();
};
}, [manifestURL]);
},
/**
Checks for downloads without applying them.
*/
stageUpdate: function(manifestURL) {
// do it in chrome so we don't need to switch contexts...
var client = this.client.scope({ context: 'chrome' });
return client.executeAsyncScript(function(manifestURL) {
navigator.mozApps.mgmt.getAll().onsuccess = function(e) {
var list = e.target.result;
var app = list.find(function(app) {
return app.manifestURL === manifestURL;
});
var req = app.checkForUpdate();
req.onsuccess = req.onerror = function() {
marionetteScriptFinished();
};
};
}, [manifestURL]);
},
/**
Updates an installed app by it's manifest url.
@param {String} manifestURL for the application.
*/
update: function(manifestURL) {
// do it in chrome so we don't need to switch contexts...
var client = this.client.scope({ context: 'chrome' });
return client.executeAsyncScript(function(manifestURL) {
navigator.mozApps.mgmt.getAll().onsuccess = function(e) {
var list = e.target.result;
var app = list.find(function(app) {
return app.manifestURL === manifestURL;
});
var req = app.checkForUpdate();
req.onsuccess = function() {
app.download();
marionetteScriptFinished();
};
req.onerror = function() {
marionetteScriptFinished();
};
};
}, [manifestURL]);
}
};

View file

@ -0,0 +1,136 @@
'use strict';
/**
* A Marionette test helper for modal dialog flow.
*/
/**
* @constructor
* @param {Marionette.Client} client Marionette client to use.
*/
function ModalDialog(client) {
this.client = client.scope({ searchTimeout: 200000 });
this.client.helper = client.helper;
}
module.exports = ModalDialog;
ModalDialog.Selector = Object.freeze({
alert: {
dialog: '.appWindow.active .smart-modal-dialog-container' +
' .modal-dialog-opened',
ok: '.appWindow.active .modal-dialog-opened' +
' .modal-dialog-button-group smart-button:nth-child(1)',
message: '.appWindow.active .modal-dialog-opened .modal-dialog-message'
},
prompt: {
dialog: '.appWindow.active .smart-modal-dialog-container' +
' .modal-dialog-opened',
ok: '.appWindow.active .modal-dialog-opened' +
' .modal-dialog-button-group smart-button:nth-child(2)',
cancel: '.appWindow.active .modal-dialog-opened' +
' .modal-dialog-button-group smart-button:nth-child(1)',
message: '.appWindow.active .modal-dialog-opened .modal-dialog-message',
input: '.appWindow.active .modal-dialog-opened' +
' .modal-dialog-input-group input'
},
confirm: {
dialog: '.appWindow.active .smart-modal-dialog-container' +
' .modal-dialog-opened',
ok: '.appWindow.active .modal-dialog-opened' +
' .modal-dialog-button-group smart-button:nth-child(2)',
cancel: '.appWindow.active' +
' .modal-dialog-button-group smart-button:nth-child(1)',
message: '.appWindow.active .modal-dialog-opened .modal-dialog-message'
}
});
ModalDialog.prototype = {
get alertDialog() {
return this.client.findElement(ModalDialog.Selector.alert.dialog);
},
get alertOk() {
return this.client.findElement(ModalDialog.Selector.alert.ok);
},
get alertMessage() {
return this.client.findElement(ModalDialog.Selector.alert.message);
},
get promptDialog() {
return this.client.findElement(ModalDialog.Selector.prompt.dialog);
},
get promptOk() {
return this.client.findElement(ModalDialog.Selector.prompt.ok);
},
get promptCancel() {
return this.client.findElement(ModalDialog.Selector.prompt.cancel);
},
get promptTitle() {
return this.client.findElement(ModalDialog.Selector.prompt.title);
},
get promptMessage() {
return this.client.findElement(ModalDialog.Selector.prompt.message);
},
get promptInput() {
return this.client.findElement(ModalDialog.Selector.prompt.input);
},
get confirmDialog() {
return this.client.findElement(ModalDialog.Selector.confirm.dialog);
},
get confirmOk() {
return this.client.findElement(ModalDialog.Selector.confirm.ok);
},
get confirmCancel() {
return this.client.findElement(ModalDialog.Selector.confirm.cancel);
},
get confirmMessage() {
return this.client.findElement(ModalDialog.Selector.confirm.message);
},
/**
* Wait for the specified element to show and send key to it
* @param {Marionette.Element} element The element to wait for.
* @param {String} key The desired key to send to element.
*/
sendKeyToElement: function(element, key) {
this.client.waitFor(function() {
return element.displayed();
}, function() {
element.sendKeys(key);
});
},
/**
* Wait for the specified dialog to open.
* @param {Marionette.Element} element The dialog element to wait for.
*/
waitForDialogOpened: function(element) {
this.client.waitFor(function() {
var dialogClass = element.getAttribute('class');
return dialogClass.indexOf('visible') != -1;
});
},
/**
* Wait for the specified dialog to close.
* @param {Marionette.Element} element The dialog element to wait for.
*/
waitForDialogClosed: function(element) {
this.client.waitFor(function() {
var dialogClass = element.getAttribute('class');
return dialogClass.indexOf('visible') == -1;
});
}
};

View file

@ -0,0 +1,116 @@
'use strict';
function System(client) {
this.client = client.scope({
searchTimeout: 20000
});
}
module.exports = System;
System.URL = 'app://smart-system.gaiamobile.org/manifest.webapp';
System.Selector = Object.freeze({
appChromeContextMenuContainer: '.appWindow.active .modal-dialog',
appChromeContextMenuDialog: '.appWindow.active .contextmenu .modal-dialog',
appInstallCancelButton: '.app-install-dialog smart-button:nth-child(1)',
appInstallInstallButton: '.app-install-dialog smart-button:nth-child(2)',
appCancelInstallConfirmButton:
'.app-install-cancel-dialog smart-button:nth-child(1)',
appCanelInstallResumeButton:
'.app-install-cancel-dialog smart-button:nth-child(2)',
appUninstallCancelButton: '.app-uninstall-dialog smart-button:nth-child(1)',
appUninstallConfirmButton: '.app-uninstall-dialog smart-button:nth-child(2)',
appInstallSetupLaterButton: '.setup-app-dialog smart-button:nth-child(1)',
appInstallSetupNowButton: '.setup-app-dialog smart-button:nth-child(2)'
});
System.prototype = {
client: null,
URL: System.URL,
Selector: System.Selector,
get appChromeContextMenuContainer() {
return this.client.helper.waitForElement(
System.Selector.appChromeContextMenuContainer);
},
get appChromeContextMenu() {
return this.client.helper.waitForElement(
System.Selector.appChromeContextMenuDialog);
},
getAppIframe: function(url) {
return this.client.findElement('iframe[src*="' + url + '"]');
},
getHomescreenIframe: function() {
return this.client.findElement('#homescreen iframe');
},
waitForLaunch: function(url) {
this.client.apps.launch(url);
var iframe = this.getAppIframe(url);
this.client.waitFor(function() {
return iframe.displayed();
});
return iframe;
},
waitForEvent: function(evt) {
this.client.switchToFrame();
this.client.executeAsyncScript(function(evt) {
var win = window.wrappedJSObject;
win.addEventListener(evt, function trWait() {
win.removeEventListener(evt, trWait);
marionetteScriptFinished();
});
}, [evt]);
},
_waitForAppState: function(manifestURL, installed) {
this.client.waitFor(function() {
return this.client.executeScript(function(manifestURL, installed) {
var apps = window.wrappedJSObject.applications;
var hasApp = !!apps.installedApps[manifestURL];
return hasApp === installed;
}, [manifestURL, installed]);
}.bind(this));
},
waitForAppInstalled: function(manifestURL) {
return this._waitForAppState(manifestURL, true);
},
waitForAppUninstalled: function(manifestURL) {
return this._waitForAppState(manifestURL, false);
},
isAppInstalled: function(manifestURL) {
return this.client.executeScript(function(manifestURL) {
return !!window.wrappedJSObject.applications.installedApps[manifestURL];
}, [manifestURL]);
},
goHome: function() {
this.client.switchToFrame();
this.client.executeAsyncScript(function() {
var win = window.wrappedJSObject;
win.addEventListener('homescreenopened', function trWait() {
win.removeEventListener('homescreenopened', trWait);
marionetteScriptFinished();
});
win.dispatchEvent(new CustomEvent('home'));
});
},
tapHome: function() {
this.client.switchToFrame();
this.client.executeScript(function() {
window.wrappedJSObject.dispatchEvent(new CustomEvent('home'));
});
}
};