OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../js/resources/js-test-pre.js"></script> | 4 <script src="../js/resources/js-test-pre.js"></script> |
5 </head> | 5 </head> |
6 <body id="body"> | 6 <body id="body"> |
7 | 7 |
8 <div id="console"></div> | 8 <div id="console"></div> |
9 | 9 |
10 <script> | 10 <script> |
11 | 11 |
12 description("This tests that pausing/resuming speech jobs works as expected.
"); | 12 description("This tests that pausing/resuming speech jobs works as expected.
"); |
13 | 13 |
14 if (window.testRunner) | 14 if (window.testRunner) |
15 testRunner.waitUntilDone(); | 15 testRunner.waitUntilDone(); |
16 if (window.internals) | 16 if (window.internals) |
17 window.internals.enableMockSpeechSynthesizer(); | 17 window.internals.enableMockSpeechSynthesizer(document); |
18 | 18 |
19 window.jsTestIsAsync = true; | 19 window.jsTestIsAsync = true; |
20 | 20 |
21 var u = new SpeechSynthesisUtterance("this is a test"); | 21 var u = new SpeechSynthesisUtterance("this is a test"); |
22 | 22 |
23 // Verify that callbacks and state are correct for paused and speaking state
s. | 23 // Verify that callbacks and state are correct for paused and speaking state
s. |
24 u.onpause = function(event) { | 24 u.onpause = function(event) { |
25 debug("On pause event received."); | 25 debug("On pause event received."); |
26 shouldBeTrue("speechSynthesis.paused"); | 26 shouldBeTrue("speechSynthesis.paused"); |
27 shouldBeTrue("speechSynthesis.speaking"); | 27 shouldBeTrue("speechSynthesis.speaking"); |
(...skipping 16 matching lines...) Expand all Loading... |
44 | 44 |
45 // Quickly pause and resume the speech job. | 45 // Quickly pause and resume the speech job. |
46 setTimeout("speechSynthesis.pause()", 1); | 46 setTimeout("speechSynthesis.pause()", 1); |
47 setTimeout("speechSynthesis.resume()", 2); | 47 setTimeout("speechSynthesis.resume()", 2); |
48 | 48 |
49 </script> | 49 </script> |
50 | 50 |
51 <script src="../js/resources/js-test-post.js"></script> | 51 <script src="../js/resources/js-test-post.js"></script> |
52 </body> | 52 </body> |
53 </html> | 53 </html> |
OLD | NEW |