@@ -3722,11 +3722,16 @@ def test_fetch_stream_file(self):
3722
3722
f .close ()
3723
3723
self .btest ('fetch/stream_file.cpp' , expected = '1' , args = ['--std=c++11' , '-s' , 'FETCH_DEBUG=1' , '-s' , 'FETCH=1' , '-s' , 'TOTAL_MEMORY=536870912' ])
3724
3724
3725
- # Tests emscripten_fetch() usage in synchronous mode.
3725
+ # Tests emscripten_fetch() usage in synchronous mode when used from the main thread proxied to a Worker with -s PROXY_TO_PTHREAD=1 option .
3726
3726
def test_fetch_sync_xhr (self ):
3727
3727
shutil .copyfile (path_from_root ('tests' , 'gears.png' ), os .path .join (self .get_dir (), 'gears.png' ))
3728
3728
self .btest ('fetch/sync_xhr.cpp' , expected = '1' , args = ['--std=c++11' , '-s' , 'FETCH_DEBUG=1' , '-s' , 'FETCH=1' , '-s' , 'USE_PTHREADS=1' , '-s' , 'PROXY_TO_PTHREAD=1' ])
3729
3729
3730
+ # Tests that the Fetch API works for synchronous XHRs when used with --proxy-to-worker.
3731
+ def test_fetch_sync_xhr_in_proxy_to_worker (self ):
3732
+ shutil .copyfile (path_from_root ('tests' , 'gears.png' ), os .path .join (self .get_dir (), 'gears.png' ))
3733
+ self .btest ('fetch/sync_xhr.cpp' , expected = '1' , args = ['--std=c++11' , '-s' , 'FETCH_DEBUG=1' , '-s' , 'FETCH=1' , '--proxy-to-worker' ])
3734
+
3730
3735
def test_fetch_idb_store (self ):
3731
3736
self .btest ('fetch/idb_store.cpp' , expected = '0' , args = ['-s' , 'USE_PTHREADS=1' , '-s' , 'FETCH_DEBUG=1' , '-s' , 'FETCH=1' , '-s' , 'PROXY_TO_PTHREAD=1' ])
3732
3737
0 commit comments