OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../js/resources/js-test-pre.js"></script> |
| 5 </head> |
| 6 <body id="body"> |
| 7 |
| 8 <div id="console"></div> |
| 9 |
| 10 <script> |
| 11 |
| 12 if (window.internals) |
| 13 window.internals.enableMockSpeechSynthesizer(); |
| 14 |
| 15 description("This tests that the basic mechanisms of speaking text work, inc
luding sending the job and receving the callback."); |
| 16 |
| 17 if (window.testRunner) |
| 18 testRunner.waitUntilDone(); |
| 19 |
| 20 window.jsTestIsAsync = true; |
| 21 |
| 22 // Start a very short speaking job that will finish quickly. |
| 23 var u = new SpeechSynthesisUtterance(" "); |
| 24 |
| 25 u.onstart = function(event) { |
| 26 shouldBeTrue("event.elapsedTime > 0"); |
| 27 shouldBeTrue("speechSynthesis.speaking"); |
| 28 } |
| 29 u.onend = function(event) { |
| 30 shouldBeTrue("event.elapsedTime > 0"); |
| 31 shouldBeFalse("speechSynthesis.speaking"); |
| 32 finishJSTest(); |
| 33 } |
| 34 |
| 35 shouldBeFalse("speechSynthesis.speaking"); |
| 36 speechSynthesis.speak(u); |
| 37 |
| 38 </script> |
| 39 |
| 40 <script src="../js/resources/js-test-post.js"></script> |
| 41 </body> |
| 42 </html> |
OLD | NEW |