@@ -818,9 +818,8 @@ def test_sdl_canvas(self):
818
818
self .clear ()
819
819
self .btest_exit ('sdl_canvas.c' , args = ['-sLEGACY_GL_EMULATION' , '-O2' , '-sSAFE_HEAP' , '-lSDL' , '-lGL' ])
820
820
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' )
824
823
html = read_file ('test.html' )
825
824
html = html .replace ('</body>' , '''
826
825
<script>
@@ -848,7 +847,8 @@ def test_glgears_proxy_jstarget(self):
848
847
# test .js target with --proxy-worker; emits 2 js files, client and worker
849
848
self .compile_btest ([test_file ('hello_world_gles_proxy.c' ), '-o' , 'test.js' , '--proxy-to-worker' , '-sGL_TESTING' , '-lGL' , '-lglut' ])
850
849
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 ()
852
852
self .run_browser ('test.html' , None , '/report_result?0' )
853
853
854
854
def test_sdl_canvas_alpha (self ):
@@ -3140,29 +3140,8 @@ def test_sdl2_image_prepare_data(self):
3140
3140
3141
3141
@requires_graphics_hardware
3142
3142
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
-
3163
3143
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 )
3166
3145
3167
3146
def test_sdl2_pumpevents (self ):
3168
3147
# key events should be detected using SDL_PumpEvents
@@ -3253,8 +3232,8 @@ def test_sdl2_canvas_write(self):
3253
3232
3254
3233
@requires_graphics_hardware
3255
3234
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 ()
3258
3237
html = read_file ('test.html' )
3259
3238
html2 = html .replace ('''Module['postRun'] = doReftest;''' , '' ) # we don't want the very first frame
3260
3239
assert html != html2
0 commit comments