Currently the TTS tests require some logic to determine which tests to run on various platforms. This is to prevent test failures for unsupported features on a given platform. Unfortunately, for TTS there are multiple levels of checks that need to be run as there are a slew of variances for this.
- Is speechSynthesis available
- Is speechSynthesis available and actually working (e.g. an audio engine present)
- Are pause/resume events supported
For the tests we determine if TTS is supported and if so run tests and if not run a fake test that reports no tests should be run. However, we also have to determine if the TTS is supported to run a second set of tests for pause/resume only if those events are also supported.
At the moment this makes use of both contextAwareness and the "fluid.test.conditionalTestUtils.chooseTestByPromiseResult" utility for sorting parts out. It ends up requiring that the TTS support check is run twice.
Ideally we'd be able to layer or aggregate parts so that each of the checks only has to be run a single time.