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 description("This tests that a speech job will generate the correct boundary
events."); |
| 13 |
| 14 if (window.testRunner) |
| 15 testRunner.waitUntilDone(); |
| 16 |
| 17 if (window.internals) |
| 18 window.internals.enableMockSpeechSynthesizer(); |
| 19 |
| 20 window.jsTestIsAsync = true; |
| 21 |
| 22 var u = new SpeechSynthesisUtterance("this is a test"); |
| 23 u.onstart = function(event) { |
| 24 debug("Speech started"); |
| 25 } |
| 26 |
| 27 u.onboundary = function(event) { |
| 28 debug("Boundary event: " + event.name + ", Character index: " + event.cha
rIndex); |
| 29 } |
| 30 |
| 31 u.onend = function(event) { |
| 32 finishJSTest(); |
| 33 } |
| 34 |
| 35 // Queue the first job which will start speaking immediately. |
| 36 speechSynthesis.speak(u); |
| 37 |
| 38 </script> |
| 39 |
| 40 <script src="../js/resources/js-test-post.js"></script> |
| 41 </body> |
| 42 </html> |
OLD | NEW |