diff --git a/test/clientside_vertex_arrays_es3.c b/test/clientside_vertex_arrays_es3.c index 410e32a8c7516..67e0df82a1407 100644 --- a/test/clientside_vertex_arrays_es3.c +++ b/test/clientside_vertex_arrays_es3.c @@ -18,6 +18,9 @@ void onDraw(void* arg) { glDrawArrays(GL_TRIANGLES, 0, 3); glfwSwapBuffers(window); glfwPollEvents(); +#ifdef __EMSCRIPTEN__ + EM_ASM(doReftest()); // All done, perform the JS side image comparison reftest. +#endif } void onResize(GLFWwindow* window, int width, int height) { @@ -112,6 +115,10 @@ int main() { } #ifdef __EMSCRIPTEN__ + // This test kicks off an asynchronous main loop, so do not perform a synchronous + // reftest immediately after falling out from main. + EM_ASM({ delete Module['postRun']; }); + emscripten_set_main_loop_arg(onDraw, &window, 0, 1); #else while (1) {