diff options
| author | Alon Zakai <alonzakai@gmail.com> | 2012-07-18 16:24:37 -0700 | 
|---|---|---|
| committer | Alon Zakai <alonzakai@gmail.com> | 2012-07-18 16:24:37 -0700 | 
| commit | a97aab0522858f3e24ab96fe93e7be9e2b976878 (patch) | |
| tree | f8585d79dc26206ca04786ee7a3538934eb86eac /tests/emscripten_fs_api_browser.cpp | |
| parent | 168e8fd12dca0316f4edd08da5fb0c2608d67368 (diff) | |
refactor file preloading to happen in FS.createPreloadedFile, so that not only file_packager preloading gets preloaded Images and Audios
Diffstat (limited to 'tests/emscripten_fs_api_browser.cpp')
| -rw-r--r-- | tests/emscripten_fs_api_browser.cpp | 17 | 
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;  | 
