blob: 689768e2b561f2e4f5d8aec92703d5f44d362465 [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 a speech job will generate the correct boundary events.");
if (window.testRunner)
testRunner.waitUntilDone();
if (window.internals)
internals.enableMockSpeechSynthesizer(window);
window.jsTestIsAsync = true;
var u = new SpeechSynthesisUtterance("this is a test");
u.onstart = function(event) {
debug("Speech started");
}
u.onboundary = function(event) {
debug("Boundary event: " + event.name + ", Character index: " + event.charIndex);
}
u.onend = function(event) {
finishJSTest();
}
// Queue the first job which will start speaking immediately.
speechSynthesis.speak(u);
</script>
</body>
</html>