aboutsummaryrefslogtreecommitdiff
path: root/tests/emscripten_fs_api_browser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/emscripten_fs_api_browser.cpp')
-rw-r--r--tests/emscripten_fs_api_browser.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/emscripten_fs_api_browser.cpp b/tests/emscripten_fs_api_browser.cpp
index 07469f34..bfe33213 100644
--- a/tests/emscripten_fs_api_browser.cpp
+++ b/tests/emscripten_fs_api_browser.cpp
@@ -1,22 +1,25 @@
#include<stdio.h>
#include<emscripten.h>
#include<assert.h>
-#include <string.h>
-
+#include<string.h>
+#include<SDL/SDL.h>
+#include"SDL/SDL_image.h"
+
extern "C" {
int result = 1;
int get_count = 0;
void wait_wgets() {
- if (get_count == 2) {
+ if (get_count == 3) {
+ assert(IMG_Load("screen_shot.png"));
emscripten_cancel_main_loop();
REPORT_RESULT();
}
}
void onLoaded(const char* file) {
- if (strcmp(file, "/tmp/test.html")) {
+ if (strcmp(file, "/tmp/test.html") && strcmp(file, "/tmp/screen_shot.png")) {
result = 0;
}
@@ -60,6 +63,12 @@ int main() {
onLoaded,
onError);
+ emscripten_async_wget(
+ "http://localhost:8888/screenshot.png",
+ "/tmp/screen_shot.png",
+ onLoaded,
+ onError);
+
emscripten_set_main_loop(wait_wgets, 0);
return 0;