Skip to content

Commit d724bdb

Browse files
committed
Test audio files are needed, browser test needs to exit
1 parent 858facd commit d724bdb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

test/test_browser.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5423,7 +5423,10 @@ def test_audio_worklet_modularize(self, args):
54235423
'minimal_with_closure': (['-sMINIMAL_RUNTIME', '--closure=1', '-Oz'],),
54245424
})
54255425
def test_audio_worklet_stereo_io(self, args):
5426-
self.btest_exit('webaudio/audioworklet_in_out_stereo.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS'] + args)
5426+
os.mkdir('audio_files')
5427+
shutil.copy(test_file('webaudio/audio_files/emscripten-beat.mp3'), 'audio_files/')
5428+
shutil.copy(test_file('webaudio/audio_files/emscripten-bass.mp3'), 'audio_files/')
5429+
self.btest_exit('webaudio/audioworklet_in_out_stereo.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-DBROWSER_TEST'] + args)
54275430

54285431
def test_error_reporting(self):
54295432
# Test catching/reporting Error objects

test/webaudio/audioworklet_in_out_stereo.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ int main() {
161161
static char workletStack[AUDIO_STACK_SIZE];
162162
EMSCRIPTEN_WEBAUDIO_T context = emscripten_create_audio_context(NULL);
163163
emscripten_start_wasm_audio_worklet_thread_async(context, workletStack, sizeof workletStack, &initialised, NULL);
164+
#ifndef BROWSER_TEST
165+
// Special case: browser tests need to exit instantly, interactive tests need to wait
164166
emscripten_runtime_keepalive_push();
167+
#endif
165168
return 0;
166169
}

0 commit comments

Comments
 (0)