VulpesOS/gaia/apps/system/test/unit/mock_system_dialog.js
OverSu b38dea0597 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.
2026-09-30 23:13:03 +02:00

48 lines
1.2 KiB
JavaScript
Executable file

'use strict';
(function(exports) {
var MockSystemDialog = function SystemDialog(options) {
if (options) {
this.options = options;
}
this.instanceID = 'fake-dialog';
var dialogFake = document.createElement('div');
dialogFake.setAttribute('id', 'fake-dialog');
this.element = dialogFake;
};
MockSystemDialog.prototype._setVisibleForScreenReader = function() {};
MockSystemDialog.prototype.SUB_COMPONENTS = {};
MockSystemDialog.prototype.focus = function () {};
MockSystemDialog.prototype.show = function msd_show(reason) {
this.onShow(reason);
};
MockSystemDialog.prototype.hide = function msd_hide(reason) {
this.onHide(reason);
};
MockSystemDialog.prototype.onShow = function msd_onShow(reason) {
if (typeof(this.options.onShow) == 'function') {
this.options.onShow(reason);
}
};
MockSystemDialog.prototype.onHide = function msd_onHide(reason) {
if (typeof(this.options.onHide) == 'function') {
this.options.onHide(reason);
}
};
MockSystemDialog.prototype.broadcast =
MockSystemDialog.prototype.resize =
MockSystemDialog.prototype.updateHeight =
function() {};
exports.MockSystemDialog = MockSystemDialog;
})(window);