@@ -865,20 +865,18 @@ def post_manual_reftest(self):
865865 assert os .path .exists ('reftest.js' )
866866 html = read_file ('test.html' )
867867 html = html .replace ('</body>' , '''
868+ <script src="reftest.js"/>
868869<script>
869- function assert(x, y) { if (!x) throw 'assertion failed ' + y }
870- %s
871-
872870var windowClose = window.close;
873871window.close = () => {
874872 // wait for rafs to arrive and the screen to update before reftesting
875- setTimeout(function() {
873+ setTimeout(() => {
876874 doReftest();
877875 setTimeout(windowClose, 5000);
878876 }, 1000);
879877};
880878</script>
881- </body>''' % read_file ( 'reftest.js' ) )
879+ </body>''' )
882880 create_file ('test.html' , html )
883881
884882 def test_sdl_canvas_proxy (self ):
@@ -2108,7 +2106,7 @@ def test_cubegeom_pre3(self):
21082106 def test_cubegeom (self , args ):
21092107 # proxy only in the simple, normal case (we can't trace GL calls when
21102108 # proxied)
2111- 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 )
2109+ self .btest ('third_party/cubegeom/cubegeom.c' , reference = 'third_party/cubegeom/cubegeom.png' , args = ['-O2' , '-g' , '-sLEGACY_GL_EMULATION' , '-lGL' , '-lSDL' ] + args )
21122110
21132111 @requires_graphics_hardware
21142112 def test_cubegeom_regal (self ):
@@ -3362,10 +3360,10 @@ def test_sdl2_canvas_write(self):
33623360 def test_sdl2_gl_frames_swap (self ):
33633361 def post_build ():
33643362 self .post_manual_reftest ()
3365- html = read_file ('test.html ' )
3366- html2 = html .replace (''' Module['postRun'] = doReftest;''' , '' ) # we don't want the very first frame
3367- assert html != html2
3368- create_file ('test.html ' , html2 )
3363+ reftest = read_file ('reftest.js ' )
3364+ reftest2 = reftest .replace (" Module['postRun'] = doReftest;" , '' ) # we don't want the very first frame
3365+ assert reftest != reftest2
3366+ create_file ('reftest.js ' , reftest2 )
33693367 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 )
33703368
33713369 @no_wasm64 ('SDL2 + wasm64' )
0 commit comments