Skip to content

Commit 0deb4bb

Browse files
authored
Simplify a couple of interactive browser tests. NFC (#22021)
These tests don't need to do a separate compile and run step when they can both just use the btest helper.
1 parent ea15105 commit 0deb4bb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/test_interactive.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,13 @@ def test_sdl2_audio_beeps(self):
137137
# TODO: investigate why this does not pass
138138
self.btest_exit('browser/test_sdl2_audio_beep.cpp', args=['-O2', '--closure=1', '--minify=0', '-sDISABLE_EXCEPTION_CATCHING=0', '-sUSE_SDL=2'])
139139

140-
def test_openal_playback(self):
140+
@parameterized({
141+
'': ([],),
142+
'proxy_to_pthread': (['-sPROXY_TO_PTHREAD', '-pthread'],),
143+
})
144+
def test_openal_playback(self, args):
141145
shutil.copyfile(test_file('sounds/audio.wav'), self.in_dir('audio.wav'))
142-
143-
for args in [[], ['-pthread', '-sPROXY_TO_PTHREAD']]:
144-
self.compile_btest('openal_playback.cpp', ['-O2', '--preload-file', 'audio.wav', '-o', 'page.html'] + args)
145-
self.run_browser('page.html', '/report_result?1')
146+
self.btest('openal_playback.cpp', '1', args=['-O2', '--preload-file', 'audio.wav'] + args)
146147

147148
def test_openal_buffers(self):
148149
self.btest('openal_buffers.c', '0', args=['--preload-file', test_file('sounds/the_entertainer.wav') + '@/'],)
@@ -193,8 +194,7 @@ def get_freealut_library(self):
193194
def test_freealut(self):
194195
src = test_file('third_party/freealut/examples/hello_world.c')
195196
inc = test_file('third_party/freealut/include')
196-
self.compile_btest(src, ['-O2', '-o', 'page.html', '-I' + inc] + self.get_freealut_library())
197-
self.run_browser('page.html', message='You should hear "Hello World!"')
197+
self.btest_exit(src, args=['-O2', '-I' + inc] + self.get_freealut_library())
198198

199199
def test_glfw_cursor_disabled(self):
200200
self.btest_exit('interactive/test_glfw_cursor_disabled.c', args=['-sUSE_GLFW=3', '-lglfw', '-lGL'])

0 commit comments

Comments
 (0)