OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>SpeechSynthesisUtterance: Basic interface tests</title> |
| 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <script> |
| 6 setup(function() { |
| 7 if (window.internals) |
| 8 window.internals.enableMockSpeechSynthesizer(document); |
| 9 }); |
| 10 |
| 11 test(function() { |
| 12 var utterance = new SpeechSynthesisUtterance(" "); |
| 13 var restrictedFloatAttributes = [ 'volume', 'rate', 'pitch' ]; |
| 14 for (var i in restrictedFloatAttributes) { |
| 15 var attr = restrictedFloatAttributes[i]; |
| 16 var before = utterance[attr]; |
| 17 assert_throws(new TypeError, function() { utterance[attr] = NaN; }, attr); |
| 18 assert_throws(new TypeError, function() { utterance[attr] = Infinity; }, att
r); |
| 19 assert_equals(utterance[attr], before, 'value is unchanged.'); |
| 20 } |
| 21 }, 'SpeechSynthesisUtterance, setting non-finite values.'); |
| 22 </script> |
OLD | NEW |