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

Unified Diff: LayoutTests/fast/speechsynthesis/speech-synthesis-speak.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-speak.html
diff --git a/LayoutTests/fast/speechsynthesis/speech-synthesis-speak.html b/LayoutTests/fast/speechsynthesis/speech-synthesis-speak.html
new file mode 100644
index 0000000000000000000000000000000000000000..4278334e50f15b4aea661f5eb8b0971dddda7168
--- /dev/null
+++ b/LayoutTests/fast/speechsynthesis/speech-synthesis-speak.html
@@ -0,0 +1,42 @@
+<!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>
+
+ if (window.internals)
+ window.internals.enableMockSpeechSynthesizer();
+
+ description("This tests that the basic mechanisms of speaking text work, including sending the job and receving the callback.");
+
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ window.jsTestIsAsync = true;
+
+ // Start a very short speaking job that will finish quickly.
+ var u = new SpeechSynthesisUtterance(" ");
+
+ u.onstart = function(event) {
+ shouldBeTrue("event.elapsedTime > 0");
+ shouldBeTrue("speechSynthesis.speaking");
+ }
+ u.onend = function(event) {
+ shouldBeTrue("event.elapsedTime > 0");
+ shouldBeFalse("speechSynthesis.speaking");
+ finishJSTest();
+ }
+
+ shouldBeFalse("speechSynthesis.speaking");
+ speechSynthesis.speak(u);
+
+</script>
+
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698