1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../resources/js-test.js"></script>
8 <div id=
"console"></div>
13 window
.internals
.enableMockSpeechSynthesizer(document
);
15 description("This tests that passing an argument other than a SpeechSynthesisUtterance to speechSynthesis.speak throws a TypeError exception.");
17 shouldThrow("speechSynthesis.speak()", '"TypeError: Failed to execute \'speak\' on \'SpeechSynthesis\': 1 argument required, but only 0 present."');
18 shouldThrow("speechSynthesis.speak(0)", '"TypeError: Failed to execute \'speak\' on \'SpeechSynthesis\': Invalid utterance argument"');
19 shouldThrow("speechSynthesis.speak('')", '"TypeError: Failed to execute \'speak\' on \'SpeechSynthesis\': Invalid utterance argument"');
20 shouldThrow("speechSynthesis.speak(document.body)", '"TypeError: Failed to execute \'speak\' on \'SpeechSynthesis\': Invalid utterance argument"');
21 shouldThrow("speechSynthesis.speak({})", '"TypeError: Failed to execute \'speak\' on \'SpeechSynthesis\': Invalid utterance argument"');
22 shouldThrow("speechSynthesis.speak((new SpeechSynthesisUtterance()).text = 'hello')", '"TypeError: Failed to execute \'speak\' on \'SpeechSynthesis\': Invalid utterance argument"');