@@ -818,9 +818,8 @@ def test_sdl_canvas(self):
818818 self .clear ()
819819 self .btest_exit ('sdl_canvas.c' , args = ['-sLEGACY_GL_EMULATION' , '-O2' , '-sSAFE_HEAP' , '-lSDL' , '-lGL' ])
820820
821- def post_manual_reftest (self , reference = None ):
822- self .reftest (test_file (self .reference if reference is None else reference ))
823-
821+ def post_manual_reftest (self ):
822+ assert os .path .exists ('reftest.js' )
824823 html = read_file ('test.html' )
825824 html = html .replace ('</body>' , '''
826825<script>
@@ -848,7 +847,8 @@ def test_glgears_proxy_jstarget(self):
848847 # test .js target with --proxy-worker; emits 2 js files, client and worker
849848 self .compile_btest ([test_file ('hello_world_gles_proxy.c' ), '-o' , 'test.js' , '--proxy-to-worker' , '-sGL_TESTING' , '-lGL' , '-lglut' ])
850849 shell_with_script ('shell_minimal.html' , 'test.html' , '<script src="test.js"></script>' )
851- self .post_manual_reftest ('gears.png' )
850+ self .reftest (test_file ('gears.png' ))
851+ self .post_manual_reftest ()
852852 self .run_browser ('test.html' , None , '/report_result?0' )
853853
854854 def test_sdl_canvas_alpha (self ):
@@ -3140,29 +3140,8 @@ def test_sdl2_image_prepare_data(self):
31403140
31413141 @requires_graphics_hardware
31423142 def test_sdl2_canvas_proxy (self ):
3143- def post ():
3144- html = read_file ('test.html' )
3145- html = html .replace ('</body>' , '''
3146- <script>
3147- function assert(x, y) { if (!x) throw 'assertion failed ' + y }
3148-
3149- %s
3150-
3151- var windowClose = window.close;
3152- window.close = function() {
3153- // wait for rafs to arrive and the screen to update before reftesting
3154- setTimeout(function() {
3155- doReftest();
3156- setTimeout(windowClose, 5000);
3157- }, 1000);
3158- };
3159- </script>
3160- </body>''' % read_file ('reftest.js' ))
3161- create_file ('test.html' , html )
3162-
31633143 create_file ('data.txt' , 'datum' )
3164-
3165- self .btest ('sdl2_canvas_proxy.c' , reference = 'sdl2_canvas.png' , args = ['-sUSE_SDL=2' , '--proxy-to-worker' , '--preload-file' , 'data.txt' , '-sGL_TESTING' ], manual_reference = True , post_build = post )
3144+ self .btest ('sdl2_canvas_proxy.c' , reference = 'sdl2_canvas.png' , args = ['-sUSE_SDL=2' , '--proxy-to-worker' , '--preload-file' , 'data.txt' , '-sGL_TESTING' ], manual_reference = True , post_build = self .post_manual_reftest )
31663145
31673146 def test_sdl2_pumpevents (self ):
31683147 # key events should be detected using SDL_PumpEvents
@@ -3253,8 +3232,8 @@ def test_sdl2_canvas_write(self):
32533232
32543233 @requires_graphics_hardware
32553234 def test_sdl2_gl_frames_swap (self ):
3256- def post_build (* args ):
3257- self .post_manual_reftest (* args )
3235+ def post_build ():
3236+ self .post_manual_reftest ()
32583237 html = read_file ('test.html' )
32593238 html2 = html .replace ('''Module['postRun'] = doReftest;''' , '' ) # we don't want the very first frame
32603239 assert html != html2
0 commit comments