2 <title>SpeechSynthesisUtterance: Basic interface tests
</title>
3 <script src=
"../../resources/testharness.js"></script>
4 <script src=
"../../resources/testharnessreport.js"></script>
8 window
.internals
.enableMockSpeechSynthesizer(document
);
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.');