Index: LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-basics.html |
diff --git a/LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-basics.html b/LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-basics.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3ed5001ff37e147a593d41a10c030c2cadfeb478 |
--- /dev/null |
+++ b/LayoutTests/fast/speechsynthesis/speech-synthesis-utterance-basics.html |
@@ -0,0 +1,22 @@ |
+<!DOCTYPE html> |
+<title>SpeechSynthesisUtterance: Basic interface tests</title> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script> |
+setup(function() { |
+ if (window.internals) |
+ window.internals.enableMockSpeechSynthesizer(document); |
+}); |
+ |
+test(function() { |
+ var utterance = new SpeechSynthesisUtterance(" "); |
+ var restrictedFloatAttributes = [ 'volume', 'rate', 'pitch' ]; |
+ for (var i in restrictedFloatAttributes) { |
+ var attr = restrictedFloatAttributes[i]; |
+ var before = utterance[attr]; |
+ assert_throws(new TypeError, function() { utterance[attr] = NaN; }, attr); |
+ assert_throws(new TypeError, function() { utterance[attr] = Infinity; }, attr); |
+ assert_equals(utterance[attr], before, 'value is unchanged.'); |
+ } |
+}, 'SpeechSynthesisUtterance, setting non-finite values.'); |
+</script> |