This commit is contained in:
@@ -130,6 +130,17 @@ test('TTS selects Swedish fallback, applies rate, and cancellation invalidates c
|
||||
assert.equal(h.controller.getState(), 'IDLE');
|
||||
});
|
||||
|
||||
test('speech is reported as in progress only after the native onstart event', () => {
|
||||
const h = makeHarness();
|
||||
h.controller.speak('Hej.');
|
||||
assert.equal(h.controller.getState(), 'QUEUED');
|
||||
assert.match(h.states.at(-1).message, /Startar uppläsningen/);
|
||||
h.utterances[0].onstart();
|
||||
assert.equal(h.controller.getState(), 'SPEAKING');
|
||||
assert.match(h.states.at(-1).message, /Uppläsningen har startat/);
|
||||
assert.match(h.states.at(-1).message, /iPadens volym/);
|
||||
});
|
||||
|
||||
test('iOS user gesture primes speech silently and idle speech is not cancelled before speak', () => {
|
||||
const h = makeHarness();
|
||||
assert.equal(h.controller.activateFromUserGesture(), true);
|
||||
@@ -202,6 +213,8 @@ test('TTS and microphone are mutually exclusive', () => {
|
||||
h.controller.startListening();
|
||||
h.controller.speak('Svar');
|
||||
assert.equal(h.recognitions[0].aborted, true);
|
||||
assert.equal(h.controller.getState(), 'QUEUED');
|
||||
h.utterances[0].onstart();
|
||||
assert.equal(h.controller.getState(), 'SPEAKING');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user