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

Unified Diff: third_party/WebKit/LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-voice.html

Issue 2489123002: Drop LegacyInterfaceTypeChecking for SpeechSynthesisUtterance (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-voice.html
diff --git a/third_party/WebKit/LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-voice.html b/third_party/WebKit/LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-voice.html
new file mode 100644
index 0000000000000000000000000000000000000000..f0fa6eac68eeae071128a9376c3dbd1e447c5a47
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-voice.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>SpeechSynthesisUtterance voice attribute</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(() => {
+ const u = new SpeechSynthesisUtterance();
+ assert_equals(u.voice, null);
+}, 'initial state');
+
+test(() => {
+ const u = new SpeechSynthesisUtterance();
+ u.voice = null;
+ assert_equals(u.voice, null);
+ u.voice = undefined;
+ assert_equals(u.voice, null);
+}, 'setting to null/undefined');
+
+test(() => {
+ const u = new SpeechSynthesisUtterance();
+ for (const value of [{}, "", window]) {
+ assert_throws(new TypeError, () => { u.voice = value; } );
+ assert_equals(u.voice, null);
+ }
+}, 'setting to non-SpeechSynthesisVoice values');
+
+test(() => {
+ internals.enableMockSpeechSynthesizer(document);
+
+ const u = new SpeechSynthesisUtterance();
+ const voice = speechSynthesis.getVoices()[0];
+ // TODO(foolip): This should test instanceof SpeechSynthesisVoice when that
+ // interface is exposed.
+ assert_equals(typeof voice, "object");
+ u.voice = voice;
+ assert_equals(u.voice, voice);
+}, 'setting to SpeechSynthesisVoice');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698