Chromium Code Reviews| Index: LayoutTests/fast/speechsynthesis/speech-synthesis-pause-resume.html |
| diff --git a/LayoutTests/fast/speechsynthesis/speech-synthesis-pause-resume.html b/LayoutTests/fast/speechsynthesis/speech-synthesis-pause-resume.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..96b796ee5f19d6e091e522272adf1cc562d594be |
| --- /dev/null |
| +++ b/LayoutTests/fast/speechsynthesis/speech-synthesis-pause-resume.html |
| @@ -0,0 +1,53 @@ |
| +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| +<html> |
| +<head> |
| +<script src="../js/resources/js-test-pre.js"></script> |
| +</head> |
| +<body id="body"> |
| + |
| +<div id="console"></div> |
| + |
| +<script> |
| + |
| + description("This tests that pausing/resuming speech jobs works as expected."); |
| + |
| + if (window.testRunner) |
| + testRunner.waitUntilDone(); |
| + if (window.internals) |
| + window.internals.enableMockSpeechSynthesizer(); |
| + |
| + window.jsTestIsAsync = true; |
| + |
| + var u = new SpeechSynthesisUtterance("this is a test"); |
| + |
| + // Verify that callbacks and state are correct for paused and speaking states. |
| + u.onpause = function(event) { |
| + debug("On pause event received."); |
| + shouldBeTrue("speechSynthesis.paused"); |
| + shouldBeTrue("speechSynthesis.speaking"); |
| + } |
| + |
| + u.onresume = function(event) { |
| + debug("On resume event received."); |
| + shouldBeFalse("speechSynthesis.paused"); |
| + shouldBeTrue("speechSynthesis.speaking"); |
| + } |
| + |
| + u.onend = function(event) { |
| + debug("On end event received."); |
| + shouldBeFalse("speechSynthesis.paused"); |
| + shouldBeFalse("speechSynthesis.speaking"); |
| + finishJSTest(); |
| + } |
| + |
| + speechSynthesis.speak(u); |
| + |
| + // Quickly pause and resume the speech job. |
| + 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.
|
| + setTimeout("speechSynthesis.resume()", "2"); |
|
Tom Sepez
2013/05/10 16:40:19
nit: "2" vs 2.
|
| + |
| +</script> |
| + |
| +<script src="../js/resources/js-test-post.js"></script> |
| +</body> |
| +</html> |