Files
brave-core/test/data/speech/voices-farbling.html
Mark Pilgrim 8a6e84d049 Add a farbling-determined voice name to getVoices
call upstream function if farbling is off
add DEPS
exit early if no voices
extend test timeout
move exit condition earlier
feedback
2021-11-05 10:44:19 -04:00

33 lines
999 B
HTML

<html>
<head><title>failed</title></head>
<body></body>
<script>
if (window.speechSynthesis !== undefined) {
var voicesFormatted = function (voices) {
return voices.map(x => `${x.name} (${x.voiceURI})`).toString()
}
var speechTimeout = 1000
var speechSynthesisTimerId
var onVoicesChanged = function () {
clearTimeout(speechSynthesisTimerId)
var voices = window.speechSynthesis.getVoices()
document.title=voicesFormatted(voices);
}
speechSynthesisTimerId = setTimeout(function () {
window.speechSynthesis.removeEventListener('voiceschanged', onVoicesChanged)
document.title="";
}, speechTimeout)
var voices = window.speechSynthesis.getVoices();
if (voices.length !== 0) {
clearTimeout(speechSynthesisTimerId)
document.title=voicesFormatted(voices);
} else {
window.speechSynthesis.addEventListener('voiceschanged', onVoicesChanged)
}
}
</script>
</html>