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

Unified Diff: LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-uses-voice.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-utterance-uses-voice.html
diff --git a/LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-uses-voice.html b/LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-uses-voice.html
new file mode 100644
index 0000000000000000000000000000000000000000..035b4ce27eb24be6bc013fd2d30df8bea67fd05a
--- /dev/null
+++ b/LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-uses-voice.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>
+ description("This tests that we can get synthesizer voices on the Mac");
+
+ if (window.internals)
+ window.internals.enableMockSpeechSynthesizer();
+
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ window.jsTestIsAsync = true;
+
+ var list = speechSynthesis.getVoices();
+ var voice = list[0];
+
+ // Start a very short speaking job that will finish quickly.
+ var u = new SpeechSynthesisUtterance("this is a test string.");
+ u.voice = voice;
+
+ debug("Verify that setting and retrieving the voice works.");
+ shouldBeTrue("u.voice.name == voice.name");
+
+ u.onend = function(event) {
+ debug("Speech job finished successfully.");
+ finishJSTest();
+ }
+
+ speechSynthesis.speak(u);
+
+</script>
+
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698