18
18
from urllib .request import urlopen
19
19
20
20
import common
21
- from common import BrowserCore , RunnerCore , path_from_root , has_browser , Reporting , is_chrome , is_firefox , CHROMIUM_BASED_BROWSERS
21
+ from common import BrowserCore , RunnerCore , path_from_root , has_browser , Reporting , is_chrome , is_firefox , is_safari , CHROMIUM_BASED_BROWSERS
22
22
from common import create_file , parameterized , ensure_dir , disabled , flaky , test_file , WEBIDL_BINDER
23
23
from common import read_file , EMRUN , no_wasm64 , no_2gb , no_4gb , copytree , skip_if , skip_if_simple
24
24
from common import requires_wasm2js , parameterize , find_browser_test_file , with_all_sjlj
@@ -40,7 +40,12 @@ def sendheaders(s, extra=None, length=None):
40
40
s .send_header ("Content-Length" , str (length ))
41
41
s .send_header ("Access-Control-Allow-Origin" , "http://localhost:%s" % port )
42
42
s .send_header ('Cross-Origin-Resource-Policy' , 'cross-origin' )
43
- s .send_header ('Cache-Control' , 'no-cache, no-store, must-revalidate' )
43
+
44
+ s .send_header ('Cache-Control' , 'no-cache, no-store, must-revalidate, private, max-age=0' )
45
+ s .send_header ('Expires' , '0' )
46
+ s .send_header ('Pragma' , 'no-cache' )
47
+ s .send_header ('Vary' , '*' ) # Safari insists on caching if this header is not present in addition to the above
48
+
44
49
s .send_header ("Access-Control-Expose-Headers" , "Content-Length, Accept-Ranges" )
45
50
s .send_header ("Content-type" , "application/octet-stream" )
46
51
if support_byte_ranges :
@@ -142,6 +147,8 @@ def is_swiftshader(_):
142
147
143
148
no_firefox = skip_if ('no_firefox' , lambda _ : is_firefox (), 'firefox is not supported' )
144
149
150
+ no_safari = skip_if ('no_safari' , lambda _ : is_safari (), 'safari is not supported' )
151
+
145
152
146
153
def is_jspi (args ):
147
154
return '-sASYNCIFY=2' in args
@@ -2797,6 +2804,7 @@ def test_webgl2_pbo(self):
2797
2804
self .btest_exit ('webgl2_pbo.c' , cflags = ['-sMAX_WEBGL_VERSION=2' , '-lGL' ])
2798
2805
2799
2806
@no_firefox ('fails on CI likely due to GPU drivers there' )
2807
+ @no_safari ('TODO: Fails with report_result?5' ) # Safari 17.6 (17618.3.11.11.7, 17618)
2800
2808
@requires_graphics_hardware
2801
2809
def test_webgl2_sokol_mipmap (self ):
2802
2810
self .reftest ('third_party/sokol/mipmap-emsc.c' , 'third_party/sokol/mipmap-emsc.png' ,
@@ -2955,6 +2963,7 @@ def test_sdl2_image_jpeg(self):
2955
2963
@also_with_wasmfs
2956
2964
@requires_graphics_hardware
2957
2965
@with_all_sjlj
2966
+ @no_safari ('Test enables Wasm exceptions, so will not run in Safari 17.6 (17618.3.11.11.7, 17618)' ) # Safari 17.6 (17618.3.11.11.7, 17618)
2958
2967
def test_sdl2_image_formats (self ):
2959
2968
shutil .copy (test_file ('screenshot.png' ), '.' )
2960
2969
shutil .copy (test_file ('screenshot.jpg' ), '.' )
@@ -3356,6 +3365,7 @@ def test_async_returnvalue(self, args):
3356
3365
create_file ('filey.txt' , 'sync_tunnel\n sync_tunnel_bool\n ' )
3357
3366
self .btest ('test_async_returnvalue.c' , '0' , cflags = ['-sASSERTIONS' , '-sASYNCIFY' , '-sASYNCIFY_IGNORE_INDIRECT' , '--js-library' , test_file ('browser/test_async_returnvalue.js' )] + args )
3358
3367
3368
+ @no_safari ('TODO: Never reports a result, so times out' ) # Safari 17.6 (17618.3.11.11.7, 17618)
3359
3369
def test_async_bad_list (self ):
3360
3370
self .btest ('test_async_bad_list.c' , '0' , cflags = ['-sASYNCIFY' , '-sASYNCIFY_ONLY=waka' , '--profiling' ])
3361
3371
@@ -3408,6 +3418,7 @@ def test_modularize(self, args, code, opts):
3408
3418
self .run_browser ('a.html' , '/report_result?0' )
3409
3419
3410
3420
@no_firefox ('source phase imports not implemented yet in firefox' )
3421
+ @no_safari ('croaks on line "import source wasmModule from \' ./out.wasm\' ;"' ) # Safari 17.6 (17618.3.11.11.7, 17618)
3411
3422
def test_source_phase_imports (self ):
3412
3423
self .compile_btest ('browser_test_hello_world.c' , ['-sEXPORT_ES6' , '-sSOURCE_PHASE_IMPORTS' , '-Wno-experimental' , '-o' , 'out.mjs' ])
3413
3424
create_file ('a.html' , '''
@@ -3794,6 +3805,7 @@ def test_pthread_gcc_64bit_atomic_fetch_and_op(self):
3794
3805
3795
3806
# Test the old GCC atomic __sync_op_and_fetch builtin operations.
3796
3807
@also_with_wasm2js
3808
+ @no_safari ('TODO: browser.test_pthread_gcc_atomic_op_and_fetch_wasm2js fails with "abort:Assertion failed: nand_and_fetch_data == -1"' ) # Safari 17.6 (17618.3.11.11.7, 17618)
3797
3809
def test_pthread_gcc_atomic_op_and_fetch (self ):
3798
3810
self .cflags += ['-Wno-sync-fetch-and-nand-semantics-changed' ]
3799
3811
self .btest_exit ('pthread/test_pthread_gcc_atomic_op_and_fetch.c' , cflags = ['-O3' , '-pthread' , '-sPTHREAD_POOL_SIZE=8' ])
@@ -3891,6 +3903,7 @@ def test_pthread_cleanup(self):
3891
3903
'' : ([],),
3892
3904
'spinlock' : (['-DSPINLOCK_TEST' ],),
3893
3905
})
3906
+ @no_safari ('TODO: browser.test_pthread_mutex and browser.test_pthread_mutex_spinlock both hang Safari' ) # Safari 17.6 (17618.3.11.11.7, 17618)
3894
3907
def test_pthread_mutex (self , args ):
3895
3908
self .btest_exit ('pthread/test_pthread_mutex.c' , cflags = ['-O3' , '-pthread' , '-sPTHREAD_POOL_SIZE=8' ] + args )
3896
3909
@@ -4078,6 +4091,7 @@ def test_pthread_safe_stack(self):
4078
4091
'no_leak' : ['test_pthread_lsan_no_leak' , []],
4079
4092
})
4080
4093
@no_firefox ('https://github.com/emscripten-core/emscripten/issues/15978' )
4094
+ @no_safari ('TODO: browser.test_pthread_lsan_leak fails with /report_result?0' ) # Safari 17.6 (17618.3.11.11.7, 17618)
4081
4095
def test_pthread_lsan (self , name , args ):
4082
4096
self .btest (Path ('pthread' , name + '.cpp' ), expected = '1' , cflags = ['-fsanitize=leak' , '-pthread' , '-sPROXY_TO_PTHREAD' , '--pre-js' , test_file ('pthread' , name + '.js' )] + args )
4083
4097
@@ -4089,6 +4103,7 @@ def test_pthread_lsan(self, name, args):
4089
4103
'leak' : ['test_pthread_lsan_leak' , ['-gsource-map' ]],
4090
4104
'no_leak' : ['test_pthread_lsan_no_leak' , []],
4091
4105
})
4106
+ @no_safari ('TODO: browser.test_pthread_asan_leak fails with /report_result?0' ) # Safari 17.6 (17618.3.11.11.7, 17618)
4092
4107
def test_pthread_asan (self , name , args ):
4093
4108
self .btest (Path ('pthread' , name + '.cpp' ), expected = '1' , cflags = ['-fsanitize=address' , '-pthread' , '-sPROXY_TO_PTHREAD' , '--pre-js' , test_file ('pthread' , name + '.js' )] + args )
4094
4109
@@ -4102,6 +4117,7 @@ def test_pthread_asan_use_after_free(self):
4102
4117
@no_2gb ('ASAN + GLOBAL_BASE' )
4103
4118
@no_4gb ('ASAN + GLOBAL_BASE' )
4104
4119
@no_firefox ('https://github.com/emscripten-core/emscripten/issues/20006' )
4120
+ @no_safari ('TODO: Hangs' ) # Safari Version 18.5 (20621.2.5.11.8)
4105
4121
@also_with_wasmfs
4106
4122
def test_pthread_asan_use_after_free_2 (self ):
4107
4123
# similiar to test_pthread_asan_use_after_free, but using a pool instead
@@ -4120,6 +4136,7 @@ def test_pthread_exit_process(self):
4120
4136
args += ['--pre-js' , test_file ('core/pthread/test_pthread_exit_runtime.pre.js' )]
4121
4137
self .btest ('core/pthread/test_pthread_exit_runtime.c' , expected = 'onExit status: 42' , cflags = args )
4122
4138
4139
+ @no_safari ('TODO: Fails with report_result?unexpected: [object ErrorEvent]' ) # Safari 17.6 (17618.3.11.11.7, 17618)
4123
4140
def test_pthread_trap (self ):
4124
4141
create_file ('pre.js' , '''
4125
4142
if (typeof window === 'object' && window) {
@@ -5376,6 +5393,7 @@ def test_wasmfs_fetch_backend_threaded(self, args):
5376
5393
'jspi' : (['-Wno-experimental' , '-sASYNCIFY=2' ],),
5377
5394
'jspi_wasm_bigint' : (['-Wno-experimental' , '-sASYNCIFY=2' , '-sWASM_BIGINT' ],),
5378
5395
})
5396
+ @no_safari ('TODO: Fails with abort:Assertion failed: err == 0' ) # Safari 17.6 (17618.3.11.11.7, 17618)
5379
5397
def test_wasmfs_opfs (self , args ):
5380
5398
if '-sASYNCIFY=2' in args :
5381
5399
self .require_jspi ()
@@ -5385,6 +5403,7 @@ def test_wasmfs_opfs(self, args):
5385
5403
self .btest_exit (test , cflags = args + ['-DWASMFS_RESUME' ])
5386
5404
5387
5405
@no_firefox ('no OPFS support yet' )
5406
+ @no_safari ('TODO: Fails with exception:Did not get expected EIO when unlinking file' ) # Safari 17.6 (17618.3.11.11.7, 17618)
5388
5407
def test_wasmfs_opfs_errors (self ):
5389
5408
test = test_file ('wasmfs/wasmfs_opfs_errors.c' )
5390
5409
postjs = test_file ('wasmfs/wasmfs_opfs_errors_post.js' )
@@ -5459,6 +5478,7 @@ def test_manual_pthread_proxy_hammer(self, args):
5459
5478
def test_assert_failure (self ):
5460
5479
self .btest ('test_assert_failure.c' , 'abort:Assertion failed: false && "this is a test"' )
5461
5480
5481
+ @no_safari ('TODO: Fails with report_result?exception:rejected! / undefined' ) # Safari 17.6 (17618.3.11.11.7, 17618)
5462
5482
def test_pthread_unhandledrejection (self ):
5463
5483
# Check that an unhandled promise rejection is propagated to the main thread
5464
5484
# as an error. This test is failing if it hangs!
0 commit comments