blob: 5ec406e251c8958a9852c30b5229d07fb1b333d1 [file] [log] [blame]
<!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)
internals.enableMockSpeechSynthesizer(window);
});
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>