File tree Expand file tree Collapse file tree
tests/component-tests/textToSpeech/js Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -171,19 +171,31 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
171171 jqUnit . assertFalse ( "Shouldn't be paused" , that . model . paused ) ;
172172 } ;
173173
174- fluid . tests . textToSpeech . issueTest = function ( testFunc ) {
175- var runTests = fluid . textToSpeech . checkTTSSupport ( ) ;
176- runTests . then ( function ( ) {
177- testFunc ( ) ;
178- } , fluid . tests . textToSpeech . bypassTest ) ;
179- } ;
180-
181174 fluid . tests . textToSpeech . bypassTest = function ( ) {
182175 jqUnit . test ( "Tests were skipped - browser does not appear to support TTS" , function ( ) {
183176 jqUnit . assert ( "TESTS SKIPPED - browser does not support SpeechSynthesis" ) ;
184177 } ) ;
185178 } ;
186179
187- fluid . tests . textToSpeech . issueTest ( fluid . tests . textToSpeech . ttsTestEnvironment ) ;
180+ var ttsStatus ;
181+
182+ jqUnit . asyncTest ( "Confirming if TTS is available" , function ( ) {
183+ jqUnit . expect ( 1 ) ;
184+ var ttsSupport = fluid . textToSpeech . checkTTSSupport ( ) ;
185+ ttsSupport . then ( function ( ) {
186+ ttsStatus = "TTS is available" ;
187+ fluid . tests . textToSpeech . ttsTestEnvironment ( ) ;
188+ } , function ( ) {
189+ ttsStatus = "TTS is unavailable" ;
190+ fluid . tests . textToSpeech . bypassTest ( ) ;
191+ } ) ;
192+
193+ var ttsTest = function ( ) {
194+ jqUnit . start ( ) ;
195+ jqUnit . assert ( ttsStatus ) ;
196+ } ;
197+
198+ setTimeout ( ttsTest , 1500 ) ;
188199
200+ } ) ;
189201} ) ( ) ;
You can’t perform that action at this time.
0 commit comments