blob: 737a13cb3143d68950a3b489e9f7609472fc2b56 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test.js"></script>
</head>
<body id="body">
<div id="console"></div>
<script>
description("This tests that we can get synthesizer voices on the Mac");
if (window.internals)
internals.enableMockSpeechSynthesizer(window);
if (window.testRunner)
testRunner.waitUntilDone();
window.jsTestIsAsync = true;
var list = speechSynthesis.getVoices();
var voice = list[0];
// Start a very short speaking job that will finish quickly.
var u = new SpeechSynthesisUtterance("this is a test string.");
u.voice = voice;
debug("Verify that setting and retrieving the voice works.");
shouldBeTrue("u.voice.name == voice.name");
u.onend = function(event) {
debug("Speech job finished successfully.");
finishJSTest();
}
speechSynthesis.speak(u);
</script>
</body>
</html>