@@ -4823,13 +4823,13 @@ def test_preallocated_heap(self):
4823
4823
@also_with_wasm2js
4824
4824
def test_fetch_to_memory (self ):
4825
4825
# Test error reporting in the negative case when the file URL doesn't exist. (http 404)
4826
- self .btest_exit ('fetch/to_memory .cpp' ,
4826
+ self .btest_exit ('fetch/test_fetch_to_memory .cpp' ,
4827
4827
args = ['-sFETCH_DEBUG' , '-sFETCH' , '-DFILE_DOES_NOT_EXIST' ])
4828
4828
4829
4829
# Test the positive case when the file URL exists. (http 200)
4830
4830
shutil .copyfile (test_file ('gears.png' ), 'gears.png' )
4831
4831
for arg in [[], ['-sFETCH_SUPPORT_INDEXEDDB=0' ]]:
4832
- self .btest_exit ('fetch/to_memory .cpp' ,
4832
+ self .btest_exit ('fetch/test_fetch_to_memory .cpp' ,
4833
4833
args = ['-sFETCH_DEBUG' , '-sFETCH' ] + arg )
4834
4834
4835
4835
@parameterized ({
@@ -4840,30 +4840,28 @@ def test_fetch_to_memory(self):
4840
4840
@requires_threads
4841
4841
def test_fetch_from_thread (self , args ):
4842
4842
shutil .copyfile (test_file ('gears.png' ), 'gears.png' )
4843
- self .btest_exit ('fetch/from_thread .cpp' ,
4843
+ self .btest_exit ('fetch/test_fetch_from_thread .cpp' ,
4844
4844
args = args + ['-pthread' , '-sPROXY_TO_PTHREAD' , '-sFETCH_DEBUG' , '-sFETCH' , '-DFILE_DOES_NOT_EXIST' ],
4845
4845
also_wasm2js = True )
4846
4846
4847
4847
@also_with_wasm2js
4848
4848
def test_fetch_to_indexdb (self ):
4849
4849
shutil .copyfile (test_file ('gears.png' ), 'gears.png' )
4850
- self .btest_exit ('fetch/to_indexeddb.cpp' ,
4851
- args = ['-sFETCH_DEBUG' , '-sFETCH' ])
4850
+ self .btest_exit ('fetch/test_fetch_to_indexeddb.cpp' , args = ['-sFETCH_DEBUG' , '-sFETCH' ])
4852
4851
4853
4852
# Tests emscripten_fetch() usage to persist an XHR into IndexedDB and subsequently load up from there.
4854
4853
@also_with_wasm2js
4855
4854
def test_fetch_cached_xhr (self ):
4856
4855
shutil .copyfile (test_file ('gears.png' ), 'gears.png' )
4857
- self .btest_exit ('fetch/cached_xhr.cpp' ,
4858
- args = ['-sFETCH_DEBUG' , '-sFETCH' ])
4856
+ self .btest_exit ('fetch/test_fetch_cached_xhr.cpp' , args = ['-sFETCH_DEBUG' , '-sFETCH' ])
4859
4857
4860
4858
# Tests that response headers get set on emscripten_fetch_t values.
4861
4859
@no_firefox ('https://github.com/emscripten-core/emscripten/issues/16868' )
4862
4860
@also_with_wasm2js
4863
4861
@requires_threads
4864
4862
def test_fetch_response_headers (self ):
4865
4863
shutil .copyfile (test_file ('gears.png' ), 'gears.png' )
4866
- self .btest_exit ('fetch/response_headers .cpp' , args = ['-sFETCH_DEBUG' , '-sFETCH' , '-pthread' , '-sPROXY_TO_PTHREAD' ])
4864
+ self .btest_exit ('fetch/test_fetch_response_headers .cpp' , args = ['-sFETCH_DEBUG' , '-sFETCH' , '-pthread' , '-sPROXY_TO_PTHREAD' ])
4867
4865
4868
4866
# Test emscripten_fetch() usage to stream a XHR in to memory without storing the full file in memory
4869
4867
@also_with_wasm2js
@@ -4877,15 +4875,16 @@ def test_fetch_stream_file(self):
4877
4875
with open ('largefile.txt' , 'w' ) as f :
4878
4876
for _ in range (1024 ):
4879
4877
f .write (s )
4880
- self .btest_exit ('fetch/stream_file .cpp' ,
4878
+ self .btest_exit ('fetch/test_fetch_stream_file .cpp' ,
4881
4879
args = ['-sFETCH_DEBUG' , '-sFETCH' , '-sINITIAL_MEMORY=536870912' ])
4882
4880
4883
4881
def test_fetch_headers_received (self ):
4884
- self .btest_exit ('fetch/headers_received.cpp' , args = ['-sFETCH_DEBUG' , '-sFETCH' ])
4882
+ create_file ('myfile.dat' , 'hello world\n ' )
4883
+ self .btest_exit ('fetch/test_fetch_headers_received.c' , args = ['-sFETCH_DEBUG' , '-sFETCH' ])
4885
4884
4886
4885
def test_fetch_xhr_abort (self ):
4887
4886
shutil .copyfile (test_file ('gears.png' ), 'gears.png' )
4888
- self .btest_exit ('fetch/xhr_abort .cpp' , args = ['-sFETCH_DEBUG' , '-sFETCH' ])
4887
+ self .btest_exit ('fetch/test_fetch_xhr_abort .cpp' , args = ['-sFETCH_DEBUG' , '-sFETCH' ])
4889
4888
4890
4889
# Tests emscripten_fetch() usage in synchronous mode when used from the main
4891
4890
# thread proxied to a Worker with -sPROXY_TO_PTHREAD option.
@@ -4894,7 +4893,7 @@ def test_fetch_xhr_abort(self):
4894
4893
@requires_threads
4895
4894
def test_fetch_sync_xhr (self ):
4896
4895
shutil .copyfile (test_file ('gears.png' ), 'gears.png' )
4897
- self .btest_exit ('fetch/sync_xhr .cpp' , args = ['-sFETCH_DEBUG' , '-sFETCH' , '-pthread' , '-sPROXY_TO_PTHREAD' ])
4896
+ self .btest_exit ('fetch/test_fetch_sync_xhr .cpp' , args = ['-sFETCH_DEBUG' , '-sFETCH' , '-pthread' , '-sPROXY_TO_PTHREAD' ])
4898
4897
4899
4898
# Tests emscripten_fetch() usage when user passes none of the main 3 flags (append/replace/no_download).
4900
4899
# In that case, in append is implicitly understood.
@@ -4917,26 +4916,26 @@ def test_fetch_sync_xhr_in_wasm(self):
4917
4916
@requires_threads
4918
4917
def test_fetch_sync_xhr_in_proxy_to_worker (self ):
4919
4918
shutil .copyfile (test_file ('gears.png' ), 'gears.png' )
4920
- self .btest_exit ('fetch/sync_xhr .cpp' ,
4919
+ self .btest_exit ('fetch/test_fetch_sync_xhr .cpp' ,
4921
4920
args = ['-sFETCH_DEBUG' , '-sFETCH' , '--proxy-to-worker' ])
4922
4921
4923
4922
# Tests waiting on EMSCRIPTEN_FETCH_WAITABLE request from a worker thread
4924
4923
@unittest .skip ("emscripten_fetch_wait relies on an asm.js-based web worker" )
4925
4924
@requires_threads
4926
4925
def test_fetch_sync_fetch_in_main_thread (self ):
4927
4926
shutil .copyfile (test_file ('gears.png' ), 'gears.png' )
4928
- self .btest_exit ('fetch/sync_fetch_in_main_thread .cpp' , args = ['-sFETCH_DEBUG' , '-sFETCH' , '-sWASM=0' , '-pthread' , '-sPROXY_TO_PTHREAD' ])
4927
+ self .btest_exit ('fetch/test_fetch_sync_in_main_thread .cpp' , args = ['-sFETCH_DEBUG' , '-sFETCH' , '-sWASM=0' , '-pthread' , '-sPROXY_TO_PTHREAD' ])
4929
4928
4930
4929
@requires_threads
4931
4930
@disabled ('https://github.com/emscripten-core/emscripten/issues/16746' )
4932
4931
def test_fetch_idb_store (self ):
4933
- self .btest_exit ('fetch/idb_store .cpp' , args = ['-pthread' , '-sFETCH' , '-sWASM=0 ' , '-sPROXY_TO_PTHREAD' ])
4932
+ self .btest_exit ('fetch/test_fetch_idb_store .cpp' , args = ['-pthread' , '-sFETCH' , '-sPROXY_TO_PTHREAD' ])
4934
4933
4935
4934
@requires_threads
4936
4935
@disabled ('https://github.com/emscripten-core/emscripten/issues/16746' )
4937
4936
def test_fetch_idb_delete (self ):
4938
4937
shutil .copyfile (test_file ('gears.png' ), 'gears.png' )
4939
- self .btest_exit ('fetch/idb_delete .cpp' , args = ['-pthread' , '-sFETCH_DEBUG' , '-sFETCH' , '-sWASM=0' , '-sPROXY_TO_PTHREAD' ])
4938
+ self .btest_exit ('fetch/test_fetch_idb_delete .cpp' , args = ['-pthread' , '-sFETCH_DEBUG' , '-sFETCH' , '-sWASM=0' , '-sPROXY_TO_PTHREAD' ])
4940
4939
4941
4940
def test_fetch_post (self ):
4942
4941
self .btest_exit ('fetch/test_fetch_post.c' , args = ['-sFETCH' ])
0 commit comments