| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <script src="../../resources/js-test-pre.js"></script> |
| window.internals.enableMockSpeechSynthesizer(); |
| description("This tests that elapsed time is a number that is reasonable."); |
| testRunner.waitUntilDone(); |
| window.jsTestIsAsync = true; |
| var u = new SpeechSynthesisUtterance("hello word"); |
| u.onstart = function(event) { |
| startTime = event.elapsedTime; |
| debug("Our start time for speech should be very small."); |
| shouldBeTrue("startTime < .5"); |
| u.onboundary = function(event) { |
| debug("Word boundary received: startTime should be less than the current elapsed time."); |
| shouldBeTrue("startTime < event.elapsedTime"); |
| u.onend = function(event) { |
| debug("The finished elapsed time should be small and the startTime should have occurred before the end."); |
| shouldBeTrue("startTime < event.elapsedTime"); |
| shouldBeTrue("event.elapsedTime < 1"); |
| speechSynthesis.speak(u); |
| <script src="../../resources/js-test-post.js"></script> |