Index: Source/modules/speech/testing/PlatformSpeechSynthesizerMock.cpp |
diff --git a/Source/modules/speech/testing/PlatformSpeechSynthesizerMock.cpp b/Source/modules/speech/testing/PlatformSpeechSynthesizerMock.cpp |
index 275925bd16920b63ab34c91b71d6dbe1b58d382c..093dd409a3d74907ebb39388b3941fae1fb402d9 100644 |
--- a/Source/modules/speech/testing/PlatformSpeechSynthesizerMock.cpp |
+++ b/Source/modules/speech/testing/PlatformSpeechSynthesizerMock.cpp |
@@ -42,12 +42,14 @@ PassOwnPtr<PlatformSpeechSynthesizerMock> PlatformSpeechSynthesizerMock::create( |
PlatformSpeechSynthesizerMock::PlatformSpeechSynthesizerMock(PlatformSpeechSynthesizerClient* client) |
: PlatformSpeechSynthesizer(client) |
, m_speakingFinishedTimer(this, &PlatformSpeechSynthesizerMock::speakingFinished) |
+ , m_speakingErrorOccurredTimer(this, &PlatformSpeechSynthesizerMock::speakingErrorOccurred) |
{ |
} |
PlatformSpeechSynthesizerMock::~PlatformSpeechSynthesizerMock() |
{ |
m_speakingFinishedTimer.stop(); |
+ m_speakingErrorOccurredTimer.stop(); |
} |
void PlatformSpeechSynthesizerMock::speakingFinished(Timer<PlatformSpeechSynthesizerMock>*) |
@@ -57,6 +59,13 @@ void PlatformSpeechSynthesizerMock::speakingFinished(Timer<PlatformSpeechSynthes |
m_utterance = nullptr; |
} |
+void PlatformSpeechSynthesizerMock::speakingErrorOccurred(Timer<PlatformSpeechSynthesizerMock>*) |
+{ |
+ ASSERT(m_utterance.get()); |
+ client()->speakingErrorOccurred(m_utterance); |
+ m_utterance = nullptr; |
+} |
+ |
void PlatformSpeechSynthesizerMock::initializeVoiceList() |
{ |
m_voiceList.clear(); |
@@ -85,8 +94,7 @@ void PlatformSpeechSynthesizerMock::cancel() |
return; |
m_speakingFinishedTimer.stop(); |
- client()->speakingErrorOccurred(m_utterance); |
- m_utterance = nullptr; |
+ m_speakingErrorOccurredTimer.startOneShot(.1); |
} |
void PlatformSpeechSynthesizerMock::pause() |