Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] Simplify post_manual_reftest. NFC #21243

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions test/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,20 +865,18 @@ def post_manual_reftest(self):
assert os.path.exists('reftest.js')
html = read_file('test.html')
html = html.replace('</body>', '''
<script src="reftest.js"/>
<script>
function assert(x, y) { if (!x) throw 'assertion failed ' + y }
%s

var windowClose = window.close;
window.close = () => {
// wait for rafs to arrive and the screen to update before reftesting
setTimeout(function() {
setTimeout(() => {
doReftest();
setTimeout(windowClose, 5000);
}, 1000);
};
</script>
</body>''' % read_file('reftest.js'))
</body>''')
create_file('test.html', html)

def test_sdl_canvas_proxy(self):
Expand Down Expand Up @@ -3362,10 +3360,10 @@ def test_sdl2_canvas_write(self):
def test_sdl2_gl_frames_swap(self):
def post_build():
self.post_manual_reftest()
html = read_file('test.html')
html2 = html.replace('''Module['postRun'] = doReftest;''', '') # we don't want the very first frame
assert html != html2
create_file('test.html', html2)
reftest = read_file('reftest.js')
reftest2 = reftest.replace("Module['postRun'] = doReftest;", '') # we don't want the very first frame
assert reftest != reftest2
create_file('reftest.js', reftest2)
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)

@no_wasm64('SDL2 + wasm64')
Expand Down
Loading