mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 00:35:44 +00:00
Bug 1331696 - P2. make the speech synth mochitests pass. r=jya
MozReview-Commit-ID: 5fzgFZa8gcT --HG-- extra : rebase_source : 7ba5a9de4aa60dcbae998a8a0a7b3974a7822687
This commit is contained in:
parent
cfa7a324aa
commit
24e093653b
@ -209,7 +209,7 @@ SpeechSynthesis::Pause()
|
||||
}
|
||||
|
||||
if (mCurrentTask && !mSpeechQueue.IsEmpty() &&
|
||||
mSpeechQueue.ElementAt(0)->GetState() != SpeechSynthesisUtterance::STATE_ENDED) {
|
||||
mSpeechQueue.ElementAt(0)->GetState() == SpeechSynthesisUtterance::STATE_SPEAKING) {
|
||||
mCurrentTask->Pause();
|
||||
} else {
|
||||
mHoldQueue = true;
|
||||
@ -223,10 +223,11 @@ SpeechSynthesis::Resume()
|
||||
return;
|
||||
}
|
||||
|
||||
mHoldQueue = false;
|
||||
|
||||
if (mCurrentTask) {
|
||||
mCurrentTask->Resume();
|
||||
} else {
|
||||
mHoldQueue = false;
|
||||
AdvanceQueue();
|
||||
}
|
||||
}
|
||||
|
@ -434,6 +434,9 @@ nsSpeechTask::DispatchEnd(float aElapsedTime, uint32_t aCharIndex)
|
||||
nsresult
|
||||
nsSpeechTask::DispatchEndInner(float aElapsedTime, uint32_t aCharIndex)
|
||||
{
|
||||
// After we end, no callback functions should go through.
|
||||
mCallback = nullptr;
|
||||
|
||||
if (!mPreCanceled) {
|
||||
nsSynthVoiceRegistry::GetInstance()->SpeakNext();
|
||||
}
|
||||
|
@ -59,8 +59,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1188099
|
||||
win2.speechSynthesis.pause();
|
||||
|
||||
testSynthState(win1, { speaking: true, pending: false, paused: false});
|
||||
// 1188099: currently, paused state is not gaurenteed to be immediate.
|
||||
testSynthState(win2, { speaking: true, pending: true });
|
||||
testSynthState(win2, { speaking: true, pending: true, paused: true });
|
||||
|
||||
// We now make the utterance end.
|
||||
SpecialPowers.wrap(win1.speechSynthesis).forceEnd();
|
||||
|
@ -59,7 +59,8 @@ function testFunc(done_cb) {
|
||||
var test_data = [];
|
||||
var voices = speechSynthesis.getVoices();
|
||||
for (var voice of voices) {
|
||||
if (voice.voiceURI.indexOf('urn:moz-tts:fake-direct') < 0) {
|
||||
if (voice.lang.split("-").length > 2) {
|
||||
// Skip voices that don't automatically end with success
|
||||
continue;
|
||||
}
|
||||
test_data.push([{text: "Hello world", args: { voice: voice} },
|
||||
|
Loading…
Reference in New Issue
Block a user