@@ -257,7 +257,6 @@ def make_main(path):
257
257
make_main (dstpath )
258
258
self .compile_btest (['main.cpp' , '--preload-file' , srcpath , '-o' , 'page.html' ])
259
259
self .run_browser ('page.html' , 'You should see |load me right before|.' , '/report_result?1' )
260
- # Test that '--no-heap-copy' works.
261
260
if WINDOWS :
262
261
# On Windows, the following non-alphanumeric non-control code ASCII characters are supported.
263
262
# The characters <, >, ", |, ?, * are not allowed, because the Windows filesystem doesn't support those.
@@ -268,7 +267,7 @@ def make_main(path):
268
267
open (os .path .join (self .get_dir (), tricky_filename ), 'w' ).write ('''load me right before running the code please''' )
269
268
make_main (tricky_filename )
270
269
# As an Emscripten-specific feature, the character '@' must be escaped in the form '@@' to not confuse with the 'src@dst' notation.
271
- self .compile_btest (['main.cpp' , '--preload-file' , tricky_filename .replace ('@' , '@@' ), '--no-heap-copy' , '- o' , 'page.html' ])
270
+ self .compile_btest (['main.cpp' , '--preload-file' , tricky_filename .replace ('@' , '@@' ), '-o' , 'page.html' ])
272
271
self .run_browser ('page.html' , 'You should see |load me right before|.' , '/report_result?1' )
273
272
274
273
# By absolute path
@@ -2435,8 +2434,7 @@ def test_preload_module(self):
2435
2434
2436
2435
def test_mmap_file (self ):
2437
2436
create_test_file ('data.dat' , 'data from the file ' + ('.' * 9000 ))
2438
- for extra_args in [[], ['--no-heap-copy' ]]:
2439
- self .btest (path_from_root ('tests' , 'mmap_file.c' ), expected = '1' , args = ['--preload-file' , 'data.dat' ] + extra_args )
2437
+ self .btest (path_from_root ('tests' , 'mmap_file.c' ), expected = '1' , args = ['--preload-file' , 'data.dat' ])
2440
2438
2441
2439
def test_emrun_info (self ):
2442
2440
if not has_browser ():
@@ -2819,36 +2817,35 @@ def test_sdl2_image_formats(self):
2819
2817
'-DBITSPERPIXEL=24' , '-DNO_PRELOADED' , '-s' , 'USE_SDL=2' , '-s' , 'USE_SDL_IMAGE=2' , '-s' , 'SDL2_IMAGE_FORMATS=["jpg"]' ])
2820
2818
2821
2819
def test_sdl2_key (self ):
2822
- for defines in [[]]:
2823
- create_test_file ('pre.js' , '''
2824
- Module.postRun = function() {
2825
- function doOne() {
2826
- Module._one();
2827
- setTimeout(doOne, 1000/60);
2828
- }
2820
+ create_test_file ('pre.js' , '''
2821
+ Module.postRun = function() {
2822
+ function doOne() {
2823
+ Module._one();
2829
2824
setTimeout(doOne, 1000/60);
2830
2825
}
2826
+ setTimeout(doOne, 1000/60);
2827
+ }
2831
2828
2832
- function keydown(c) {
2833
- var event = new KeyboardEvent("keydown", { 'keyCode': c, 'charCode': c, 'view': window, 'bubbles': true, 'cancelable': true });
2834
- var prevented = !document.dispatchEvent(event);
2835
-
2836
- //send keypress if not prevented
2837
- if (!prevented) {
2838
- var event = new KeyboardEvent("keypress", { 'keyCode': c, 'charCode': c, 'view': window, 'bubbles': true, 'cancelable': true });
2839
- document.dispatchEvent(event);
2840
- }
2841
- }
2829
+ function keydown(c) {
2830
+ var event = new KeyboardEvent("keydown", { 'keyCode': c, 'charCode': c, 'view': window, 'bubbles': true, 'cancelable': true });
2831
+ var prevented = !document.dispatchEvent(event);
2842
2832
2843
- function keyup(c) {
2844
- var event = new KeyboardEvent("keyup", { 'keyCode': c, 'charCode': c, 'view': window, 'bubbles': true, 'cancelable': true });
2833
+ //send keypress if not prevented
2834
+ if (!prevented) {
2835
+ var event = new KeyboardEvent("keypress", { 'keyCode': c, 'charCode': c, 'view': window, 'bubbles': true, 'cancelable': true });
2845
2836
document.dispatchEvent(event);
2846
2837
}
2847
- ''' )
2848
- create_test_file ('sdl2_key.c' , self .with_report_result (open (path_from_root ('tests' , 'sdl2_key.c' )).read ()))
2838
+ }
2849
2839
2850
- self .compile_btest (['sdl2_key.c' , '-o' , 'page.html' ] + defines + ['-s' , 'USE_SDL=2' , '--pre-js' , 'pre.js' , '-s' , '''EXPORTED_FUNCTIONS=['_main', '_one']''' ])
2851
- self .run_browser ('page.html' , '' , '/report_result?37182145' )
2840
+ function keyup(c) {
2841
+ var event = new KeyboardEvent("keyup", { 'keyCode': c, 'charCode': c, 'view': window, 'bubbles': true, 'cancelable': true });
2842
+ document.dispatchEvent(event);
2843
+ }
2844
+ ''' )
2845
+ create_test_file ('sdl2_key.c' , self .with_report_result (open (path_from_root ('tests' , 'sdl2_key.c' )).read ()))
2846
+
2847
+ self .compile_btest (['sdl2_key.c' , '-o' , 'page.html' , '-s' , 'USE_SDL=2' , '--pre-js' , 'pre.js' , '-s' , '''EXPORTED_FUNCTIONS=['_main', '_one']''' ])
2848
+ self .run_browser ('page.html' , '' , '/report_result?37182145' )
2852
2849
2853
2850
def test_sdl2_text (self ):
2854
2851
create_test_file ('pre.js' , '''
@@ -4629,13 +4626,10 @@ def test_access_file_after_heap_resize(self):
4629
4626
self .compile_btest (['page.c' , '-s' , 'WASM=1' , '-s' , 'ALLOW_MEMORY_GROWTH=1' , '--preload-file' , 'test.txt' , '-o' , 'page.html' ])
4630
4627
self .run_browser ('page.html' , 'hello from file' , '/report_result?15' )
4631
4628
4632
- # with separate file packager invocation, letting us affect heap copying
4633
- # or lack thereof
4634
- for file_packager_args in [[], ['--no-heap-copy' ]]:
4635
- print (file_packager_args )
4636
- self .run_process ([PYTHON , FILE_PACKAGER , 'data.js' , '--preload' , 'test.txt' , '--js-output=' + 'data.js' ] + file_packager_args )
4637
- self .compile_btest (['page.c' , '-s' , 'WASM=1' , '-s' , 'ALLOW_MEMORY_GROWTH=1' , '--pre-js' , 'data.js' , '-o' , 'page.html' , '-s' , 'FORCE_FILESYSTEM=1' ])
4638
- self .run_browser ('page.html' , 'hello from file' , '/report_result?15' )
4629
+ # with separate file packager invocation
4630
+ self .run_process ([PYTHON , FILE_PACKAGER , 'data.js' , '--preload' , 'test.txt' , '--js-output=' + 'data.js' ])
4631
+ self .compile_btest (['page.c' , '-s' , 'WASM=1' , '-s' , 'ALLOW_MEMORY_GROWTH=1' , '--pre-js' , 'data.js' , '-o' , 'page.html' , '-s' , 'FORCE_FILESYSTEM=1' ])
4632
+ self .run_browser ('page.html' , 'hello from file' , '/report_result?15' )
4639
4633
4640
4634
def test_unicode_html_shell (self ):
4641
4635
create_test_file ('main.cpp' , self .with_report_result (r'''
0 commit comments