Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / speechsynthesis / speech-synthesis-utterance-basics.html
blob3ed5001ff37e147a593d41a10c030c2cadfeb478
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 });
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; }, attr);
19 assert_equals(utterance[attr], before, 'value is unchanged.');
21 }, 'SpeechSynthesisUtterance, setting non-finite values.');
22 </script>