5
5
# found in the LICENSE file.
6
6
7
7
import argparse
8
- import json
9
8
import multiprocessing
10
9
import os
11
10
import random
@@ -1712,7 +1711,7 @@ def test_chunked_synchronous_xhr(self):
1712
1711
<body>
1713
1712
Chunked XHR Web Worker Test
1714
1713
<script>
1715
- var worker = new Worker(""" + json . dumps ( worker_filename ) + r"" ");
1714
+ var worker = new Worker("%s ");
1716
1715
var buffer = [];
1717
1716
worker.onmessage = (event) => {
1718
1717
if (event.data.channel === "stdout") {
@@ -1738,7 +1737,7 @@ def test_chunked_synchronous_xhr(self):
1738
1737
</script>
1739
1738
</body>
1740
1739
</html>
1741
- """ % self .port )
1740
+ """ % ( worker_filename , self .port ) )
1742
1741
1743
1742
create_file ('worker_prejs.js' , r"""
1744
1743
Module.arguments = ["/bigfile"];
@@ -3020,12 +3019,12 @@ def test_sdl2_image_formats(self):
3020
3019
self .btest_exit ('test_sdl2_image.c' , 512 , args = [
3021
3020
'--preload-file' , 'screenshot.png' ,
3022
3021
'-DSCREENSHOT_DIRNAME="/"' , '-DSCREENSHOT_BASENAME="screenshot.png"' , '-DNO_PRELOADED' ,
3023
- '-sUSE_SDL=2' , '-sUSE_SDL_IMAGE=2' , '-sSDL2_IMAGE_FORMATS=[" png"] '
3022
+ '-sUSE_SDL=2' , '-sUSE_SDL_IMAGE=2' , '-sSDL2_IMAGE_FORMATS=png'
3024
3023
])
3025
3024
self .btest_exit ('test_sdl2_image.c' , 600 , args = [
3026
3025
'--preload-file' , 'screenshot.jpg' ,
3027
3026
'-DSCREENSHOT_DIRNAME="/"' , '-DSCREENSHOT_BASENAME="screenshot.jpg"' , '-DBITSPERPIXEL=24' , '-DNO_PRELOADED' ,
3028
- '-sUSE_SDL=2' , '-sUSE_SDL_IMAGE=2' , '-sSDL2_IMAGE_FORMATS=[" jpg"] '
3027
+ '-sUSE_SDL=2' , '-sUSE_SDL_IMAGE=2' , '-sSDL2_IMAGE_FORMATS=jpg'
3029
3028
])
3030
3029
3031
3030
@no_wasm64 ('SDL2 + wasm64' )
@@ -3423,11 +3422,11 @@ def test_sdl2_mixer_music(self, formats, flags, music_name):
3423
3422
shutil .copyfile (test_file ('sounds' , music_name ), music_name )
3424
3423
self .btest_exit ('test_sdl2_mixer_music.c' , args = [
3425
3424
'--preload-file' , music_name ,
3426
- '-DSOUND_PATH=' + json . dumps ( music_name ) ,
3425
+ '-DSOUND_PATH="%s"' % music_name ,
3427
3426
'-DFLAGS=' + flags ,
3428
3427
'-sUSE_SDL=2' ,
3429
3428
'-sUSE_SDL_MIXER=2' ,
3430
- '-sSDL2_MIXER_FORMATS=' + json . dumps (formats ),
3429
+ '-sSDL2_MIXER_FORMATS=' + ',' . join (formats ),
3431
3430
'-sINITIAL_MEMORY=33554432'
3432
3431
])
3433
3432
@@ -3510,7 +3509,7 @@ def test_async_iostream(self):
3510
3509
# ASYNCIFY_IMPORTS.
3511
3510
# To make the test more precise we also use ASYNCIFY_IGNORE_INDIRECT here.
3512
3511
@parameterized ({
3513
- 'normal' : (['-sASYNCIFY_IMPORTS=[ sync_tunnel, sync_tunnel_bool] ' ],), # noqa
3512
+ 'normal' : (['-sASYNCIFY_IMPORTS=sync_tunnel,sync_tunnel_bool' ],), # noqa
3514
3513
'pattern_imports' : (['-sASYNCIFY_IMPORTS=[sync_tun*]' ],), # noqa
3515
3514
'response' : (['[email protected] ' ],), # noqa
3516
3515
'nothing' : (['-DBAD' ],), # noqa
@@ -3523,7 +3522,7 @@ def test_async_returnvalue(self, args):
3523
3522
self .btest ('async_returnvalue.cpp' , '0' , args = ['-sASYNCIFY' , '-sASYNCIFY_IGNORE_INDIRECT' , '--js-library' , test_file ('browser/async_returnvalue.js' )] + args + ['-sASSERTIONS' ])
3524
3523
3525
3524
def test_async_bad_list (self ):
3526
- self .btest ('async_bad_list.cpp' , '0' , args = ['-sASYNCIFY' , '-sASYNCIFY_ONLY=[ waka] ' , '--profiling' ])
3525
+ self .btest ('async_bad_list.cpp' , '0' , args = ['-sASYNCIFY' , '-sASYNCIFY_ONLY=waka' , '--profiling' ])
3527
3526
3528
3527
# Tests that when building with -sMINIMAL_RUNTIME, the build can use -sMODULARIZE as well.
3529
3528
def test_minimal_runtime_modularize (self ):
@@ -4538,7 +4537,7 @@ def test_utf8_textdecoder(self):
4538
4537
4539
4538
@also_with_threads
4540
4539
def test_utf16_textdecoder (self ):
4541
- self .btest_exit ('benchmark/benchmark_utf16.cpp' , 0 , args = ['--embed-file' , test_file ('utf16_corpus.txt' ) + '@/utf16_corpus.txt' , '-sEXPORTED_RUNTIME_METHODS=[ UTF16ToString,stringToUTF16,lengthBytesUTF16] ' ])
4540
+ self .btest_exit ('benchmark/benchmark_utf16.cpp' , 0 , args = ['--embed-file' , test_file ('utf16_corpus.txt' ) + '@/utf16_corpus.txt' , '-sEXPORTED_RUNTIME_METHODS=UTF16ToString,stringToUTF16,lengthBytesUTF16' ])
4542
4541
4543
4542
@parameterized ({
4544
4543
'' : ([],),
0 commit comments