Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / speechsynthesis / speech-synthesis-speak-invalid-argument-throws.html
blob8ee0a797cdba925626fffeca73baf7bda25cee9c
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body id="body">
8 <div id="console"></div>
10 <script>
12 if (window.internals)
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"');
24 </script>
26 </body>
27 </html>