aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/emscripten_api_browser.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/emscripten_api_browser.cpp b/tests/emscripten_api_browser.cpp
index a2a19359..20e2dbb5 100644
--- a/tests/emscripten_api_browser.cpp
+++ b/tests/emscripten_api_browser.cpp
@@ -9,11 +9,20 @@ int last = 0;
extern "C" {
+bool fived = false;
+void five() {
+ fived = true;
+ emscripten_resume_main_loop();
+}
+
void mainey() {
static int counter = 0;
printf("mainey: %d\n", counter++);
- if (counter == 10) {
- int result = 1;
+ if (counter == 20) {
+ emscripten_pause_main_loop();
+ emscripten_async_call(five, 1000);
+ } else if (counter == 22) { // very soon after 20, so without pausing we fail
+ int result = fived;
REPORT_RESULT();
}
}