blob: 0aef581967e890c0674f3455d0a95685c033233c [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_js(TypeError, function() { utterance[attr] = NaN; }, attr);
assert_throws_js(TypeError, function() { utterance[attr] = Infinity; }, attr);
assert_equals(utterance[attr], before, 'value is unchanged.');
}
}, 'SpeechSynthesisUtterance, setting non-finite values.');
</script>