VulpesOS/gaia/apps/system/test/unit/mock_speech_synthesis.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

30 lines
634 B
JavaScript
Executable file

'use strict';
(function(exports) {
var listeners = {};
var MockSpeechSynthesisUtterance = function() {
this.addEventListener = function(name, callback) {
listeners[name] = callback;
};
};
var MockSpeechSynthesis = {
cancel: function() {},
speak: function() {
if (listeners.start) {
listeners.start();
}
if (listeners.end) {
listeners.end();
}
},
getVoices: function() {
return [{ lang: 'en-US' }];
}
};
exports.MockSpeechSynthesisUtterance = MockSpeechSynthesisUtterance;
exports.MockSpeechSynthesis = MockSpeechSynthesis;
}(window));