Skip to content

Commit 34a5422

Browse files
committed
Test audio files are needed, browser test needs to exit
1 parent 6b92ee4 commit 34a5422

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
@@ -5439,7 +5439,10 @@ def test_audio_worklet_modularize(self, args):
54395439
'minimal_with_closure': (['-sMINIMAL_RUNTIME', '--closure=1', '-Oz'],),
54405440
})
54415441
def test_audio_worklet_stereo_io(self, args):
5442-
self.btest_exit('webaudio/audioworklet_in_out_stereo.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS'] + args)
5442+
os.mkdir('audio_files')
5443+
shutil.copy(test_file('webaudio/audio_files/emscripten-beat.mp3'), 'audio_files/')
5444+
shutil.copy(test_file('webaudio/audio_files/emscripten-bass.mp3'), 'audio_files/')
5445+
self.btest_exit('webaudio/audioworklet_in_out_stereo.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-DBROWSER_TEST'] + args)
54435446

54445447
def test_error_reporting(self):
54455448
# 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)