| <title>SpeechSynthesisUtterance basics</title> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| for (const prop in DEFAULTS) { |
| const utt = new SpeechSynthesisUtterance(); |
| assert_equals(utt[prop], DEFAULTS[prop], prop); |
| }, `new SpeechSynthesisUtterance() default ${prop}`); |
| const utt = new SpeechSynthesisUtterance("hello"); |
| assert_equals(utt.text, 'hello', 'text'); |
| // check that the other properties retain their defaults |
| for (const prop in DEFAULTS) { |
| assert_equals(utt[prop], DEFAULTS[prop], prop); |
| }, 'new SpeechSynthesisUtterance("hello") text and defaults'); |
| const utt = new SpeechSynthesisUtterance(); |
| assert_equals(utt.text, 'word'); |
| }, 'SpeechSynthesisUtterance text setter'); |
| // TODO: setters https://github.com/w3c/speech-api/issues/29 |