@@ -862,28 +862,25 @@ def test_sdl_canvas(self):
862
862
self .btest_exit ('test_sdl_canvas.c' , args = ['-sLEGACY_GL_EMULATION' , '-O2' , '-sSAFE_HEAP' , '-lSDL' , '-lGL' ])
863
863
864
864
def post_manual_reftest (self ):
865
- assert os .path .exists ('reftest.js' )
866
865
html = read_file ('test.html' )
867
866
html = html .replace ('</body>' , '''
867
+ <script src="reftest.js"/>
868
868
<script>
869
- function assert(x, y) { if (!x) throw 'assertion failed ' + y }
870
- %s
871
-
872
869
var windowClose = window.close;
873
870
window.close = () => {
874
871
// wait for rafs to arrive and the screen to update before reftesting
875
- setTimeout(function() {
872
+ setTimeout(() => {
876
873
doReftest();
877
874
setTimeout(windowClose, 5000);
878
875
}, 1000);
879
876
};
880
877
</script>
881
- </body>''' % read_file ( 'reftest.js' ) )
878
+ </body>''' )
882
879
create_file ('test.html' , html )
883
880
884
881
def test_sdl_canvas_proxy (self ):
885
882
create_file ('data.txt' , 'datum' )
886
- self .btest ('test_sdl_canvas_proxy.c' , reference = 'browser/test_sdl_canvas_proxy.png' , args = ['--proxy-to-worker' , '--preload-file' , 'data.txt' , '-lSDL' , '-lGL' ], manual_reference = True , post_build = self . post_manual_reftest )
883
+ self .btest ('test_sdl_canvas_proxy.c' , reference = 'browser/test_sdl_canvas_proxy.png' , args = ['--proxy-to-worker' , '--preload-file' , 'data.txt' , '-lSDL' , '-lGL' ])
887
884
888
885
@requires_graphics_hardware
889
886
def test_glgears_proxy_jstarget (self ):
@@ -2115,7 +2112,7 @@ def test_cubegeom_pre3(self):
2115
2112
def test_cubegeom (self , args ):
2116
2113
# proxy only in the simple, normal case (we can't trace GL calls when
2117
2114
# proxied)
2118
- self .btest ('third_party/cubegeom/cubegeom.c' , reference = 'third_party/cubegeom/cubegeom.png' , args = ['-O2' , '-g' , '-sLEGACY_GL_EMULATION' , '-lGL' , '-lSDL' ] + args , also_proxied = not args )
2115
+ self .btest ('third_party/cubegeom/cubegeom.c' , reference = 'third_party/cubegeom/cubegeom.png' , args = ['-O2' , '-g' , '-sLEGACY_GL_EMULATION' , '-lGL' , '-lSDL' ] + args )
2119
2116
2120
2117
@no_wasm64 ('wasm64 + LEGACY_GL_EMULATION' )
2121
2118
@requires_graphics_hardware
@@ -3393,10 +3390,10 @@ def test_sdl2_canvas_write(self):
3393
3390
def test_sdl2_gl_frames_swap (self ):
3394
3391
def post_build ():
3395
3392
self .post_manual_reftest ()
3396
- html = read_file ('test.html ' )
3397
- html2 = html .replace (''' Module['postRun'] = doReftest;''' , '' ) # we don't want the very first frame
3398
- assert html != html2
3399
- create_file ('test.html ' , html2 )
3393
+ reftest = read_file ('reftest.js ' )
3394
+ reftest2 = reftest .replace (" Module['postRun'] = doReftest;" , '' ) # we don't want the very first frame
3395
+ assert reftest != reftest2
3396
+ create_file ('reftest.js ' , reftest2 )
3400
3397
self .btest ('test_sdl2_gl_frames_swap.c' , reference = 'browser/test_sdl2_gl_frames_swap.png' , args = ['--proxy-to-worker' , '-sGL_TESTING' , '-sUSE_SDL=2' ], manual_reference = True , post_build = post_build )
3401
3398
3402
3399
@no_wasm64 ('SDL2 + wasm64' )
0 commit comments