Chromium Code Reviews| 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 pausing/resuming speech jobs works as expected. "); | |
| 13 | |
| 14 if (window.testRunner) | |
| 15 testRunner.waitUntilDone(); | |
| 16 if (window.internals) | |
| 17 window.internals.enableMockSpeechSynthesizer(); | |
| 18 | |
| 19 window.jsTestIsAsync = true; | |
| 20 | |
| 21 var u = new SpeechSynthesisUtterance("this is a test"); | |
| 22 | |
| 23 // Verify that callbacks and state are correct for paused and speaking state s. | |
| 24 u.onpause = function(event) { | |
| 25 debug("On pause event received."); | |
| 26 shouldBeTrue("speechSynthesis.paused"); | |
| 27 shouldBeTrue("speechSynthesis.speaking"); | |
| 28 } | |
| 29 | |
| 30 u.onresume = function(event) { | |
| 31 debug("On resume event received."); | |
| 32 shouldBeFalse("speechSynthesis.paused"); | |
| 33 shouldBeTrue("speechSynthesis.speaking"); | |
| 34 } | |
| 35 | |
| 36 u.onend = function(event) { | |
| 37 debug("On end event received."); | |
| 38 shouldBeFalse("speechSynthesis.paused"); | |
| 39 shouldBeFalse("speechSynthesis.speaking"); | |
| 40 finishJSTest(); | |
| 41 } | |
| 42 | |
| 43 speechSynthesis.speak(u); | |
| 44 | |
| 45 // Quickly pause and resume the speech job. | |
| 46 setTimeout("speechSynthesis.pause()", "1"); | |
|
Tom Sepez
2013/05/10 16:40:19
nit: "1" vs 1.
dmazzoni
2013/05/10 18:05:23
Fixed throughout, thanks.
| |
| 47 setTimeout("speechSynthesis.resume()", "2"); | |
|
Tom Sepez
2013/05/10 16:40:19
nit: "2" vs 2.
| |
| 48 | |
| 49 </script> | |
| 50 | |
| 51 <script src="../js/resources/js-test-post.js"></script> | |
| 52 </body> | |
| 53 </html> | |
| OLD | NEW |