Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: LayoutTests/fast/speechsynthesis/speech-synthesis-pause-resume.html

Issue 14874017: Add speech synthesizer tests (from WebKit). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix ScriptWrappable::init and address nits Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..6f2b0bf2e10aaa1023f5c5325c88cdec8bfc6faa
--- /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);
+ setTimeout("speechSynthesis.resume()", 2);
+
+</script>
+
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698