diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 5d081072f84ab29761e245ac53819b1f2e290560..ecb2c6d093a8248f4a5a12c1ee5eeadd6c1ab9f3 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,13 @@ +2013-04-05 Chris Fleizach + + WebSpeech: event.elapsedTime is always 1364484608 + https://bugs.webkit.org/show_bug.cgi?id=114045 + + Reviewed by Tim Horton. + + * platform/mac/fast/speechsynthesis/speech-synthesis-elapsed-time-expected.txt: Added. + * platform/mac/fast/speechsynthesis/speech-synthesis-elapsed-time.html: Added. + 2013-04-05 Chris Fleizach WebSpeech: crash at WebCore::SpeechSynthesis::speak diff --git a/LayoutTests/platform/mac/fast/speechsynthesis/speech-synthesis-elapsed-time-expected.txt b/LayoutTests/platform/mac/fast/speechsynthesis/speech-synthesis-elapsed-time-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..81f5a25680986f9fe4e508567e5c8f0d3b8f7be4 --- /dev/null +++ b/LayoutTests/platform/mac/fast/speechsynthesis/speech-synthesis-elapsed-time-expected.txt @@ -0,0 +1,18 @@ +This tests that elapsed time is a number that is reasonable. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +Our start time for speech should be very small. +PASS startTime < .5 is true +Word boundary received: startTime should be less than the current elapsed time. +PASS startTime < event.elapsedTime is true +Word boundary received: startTime should be less than the current elapsed time. +PASS startTime < event.elapsedTime is true +The finished elapsed time should be small and the startTime should have occurred before the end. +PASS startTime < event.elapsedTime is true +PASS event.elapsedTime < 1 is true +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/platform/mac/fast/speechsynthesis/speech-synthesis-elapsed-time.html b/LayoutTests/platform/mac/fast/speechsynthesis/speech-synthesis-elapsed-time.html new file mode 100644 index 0000000000000000000000000000000000000000..7b5c6e909c87fbd728d478048b25e818893d6271 --- /dev/null +++ b/LayoutTests/platform/mac/fast/speechsynthesis/speech-synthesis-elapsed-time.html @@ -0,0 +1,48 @@ + + + + + + + +
+ + + + + + diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 586df3c2a2558d87f717cc3a5e2f0b0e15fdadd3..8d9bd504331465dc2a796a4b6903d2e128023427 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,17 @@ +2013-04-05 Chris Fleizach + + WebSpeech: event.elapsedTime is always 1364484608 + https://bugs.webkit.org/show_bug.cgi?id=114045 + + Reviewed by Tim Horton. + + We were calculating elapsed time incorrectly. + + Test: platform/mac/fast/speechsynthesis/speech-synthesis-elapsed-time.html + + * Modules/speech/SpeechSynthesis.cpp: + (WebCore::SpeechSynthesis::fireEvent): + 2013-04-05 Chris Fleizach WebSpeech: crash at WebCore::SpeechSynthesis::speak diff --git a/Source/WebCore/Modules/speech/SpeechSynthesis.cpp b/Source/WebCore/Modules/speech/SpeechSynthesis.cpp index 9b9387a2bbf8eaa214a5f48676c7e6653b08838f..1d2b58d35c403fce5a44c0a2d03227383516f58c 100644 --- a/Source/WebCore/Modules/speech/SpeechSynthesis.cpp +++ b/Source/WebCore/Modules/speech/SpeechSynthesis.cpp @@ -140,7 +140,7 @@ void SpeechSynthesis::resume() void SpeechSynthesis::fireEvent(const AtomicString& type, SpeechSynthesisUtterance* utterance, unsigned long charIndex, const String& name) { - utterance->dispatchEvent(SpeechSynthesisEvent::create(type, charIndex, (currentTime() - utterance->startTime()), name)); + utterance->dispatchEvent(SpeechSynthesisEvent::create(type, charIndex, (monotonicallyIncreasingTime() - utterance->startTime()), name)); } void SpeechSynthesis::handleSpeakingCompleted(SpeechSynthesisUtterance* utterance, bool errorOccurred)