aboutsummaryrefslogtreecommitdiff
path: root/tests/emscripten_api_browser.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-05-06 18:04:12 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-05-06 18:04:12 -0700
commitccf2e419785aa2fdc25396c707987ba9d7fc80a2 (patch)
tree72cafef4ba0301a57762b9a675d3b8b915c0a675 /tests/emscripten_api_browser.cpp
parent1d32c296019da719f323d340882c12900e85a3c2 (diff)
emscripten_pause_main_loop and resume
Diffstat (limited to 'tests/emscripten_api_browser.cpp')
-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();
}
}