@@ -865,25 +865,23 @@ def post_manual_reftest(self):
865
865
assert os .path .exists ('reftest.js' )
866
866
html = read_file ('test.html' )
867
867
html = html .replace ('</body>' , '''
868
+ <script src="reftest.js"/>
868
869
<script>
869
- function assert(x, y) { if (!x) throw 'assertion failed ' + y }
870
- %s
871
-
872
870
var windowClose = window.close;
873
871
window.close = () => {
874
872
// wait for rafs to arrive and the screen to update before reftesting
875
- setTimeout(function() {
873
+ setTimeout(() => {
876
874
doReftest();
877
875
setTimeout(windowClose, 5000);
878
876
}, 1000);
879
877
};
880
878
</script>
881
- </body>''' % read_file ( 'reftest.js' ) )
879
+ </body>''' )
882
880
create_file ('test.html' , html )
883
881
884
882
def test_sdl_canvas_proxy (self ):
885
883
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 )
884
+ 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
885
888
886
@requires_graphics_hardware
889
887
def test_glgears_proxy_jstarget (self ):
@@ -2105,7 +2103,7 @@ def test_cubegeom_pre3(self):
2105
2103
def test_cubegeom (self , args ):
2106
2104
# proxy only in the simple, normal case (we can't trace GL calls when
2107
2105
# proxied)
2108
- 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 )
2106
+ self .btest ('third_party/cubegeom/cubegeom.c' , reference = 'third_party/cubegeom/cubegeom.png' , args = ['-O2' , '-g' , '-sLEGACY_GL_EMULATION' , '-lGL' , '-lSDL' ] + args )
2109
2107
2110
2108
@requires_graphics_hardware
2111
2109
def test_cubegeom_regal (self ):
@@ -3359,10 +3357,10 @@ def test_sdl2_canvas_write(self):
3359
3357
def test_sdl2_gl_frames_swap (self ):
3360
3358
def post_build ():
3361
3359
self .post_manual_reftest ()
3362
- html = read_file ('test.html ' )
3363
- html2 = html .replace (''' Module['postRun'] = doReftest;''' , '' ) # we don't want the very first frame
3364
- assert html != html2
3365
- create_file ('test.html ' , html2 )
3360
+ reftest = read_file ('reftest.js ' )
3361
+ reftest2 = reftest .replace (" Module['postRun'] = doReftest;" , '' ) # we don't want the very first frame
3362
+ assert reftest != reftest2
3363
+ create_file ('reftest.js ' , reftest2 )
3366
3364
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 )
3367
3365
3368
3366
@no_wasm64 ('SDL2 + wasm64' )
0 commit comments