add in tests for demo end functionality
| | |
| | | ../humble_cloud/urkle_cloud.js |
| | | ASM_FLAG |
| | | NO_EXIT_RUNTIME=1 |
| | | EXPORTED_FUNCTIONS="['_main','_test_list_files','_test_async_fetch']" |
| | | EXPORTED_FUNCTIONS="['_main','_test_list_files','_test_async_fetch','_test_demo_end']" |
| | | PRE_JS |
| | | ${TEST_DATA} |
| | | JS_LIBS |
| | |
| | | extern "C" { |
| | | void test_list_files(); |
| | | void test_async_fetch(const char* url); |
| | | void test_demo_end(); |
| | | } |
| | | |
| | | std::string userDataPath = "/user_data"; |
| | |
| | | humble_fetch_asset_data(url, NULL, on_get_file, on_fail_file); |
| | | } |
| | | |
| | | void test_demo_end() |
| | | { |
| | | std::cout << "Demo has ended\n"; |
| | | humble_demo_ended(); |
| | | } |
| | | |
| | | int main(int argc, char * argv[]) |
| | | { |
| | | std::cout << "Welcome Main\n"; |
| | |
| | | <div class="emscripten_border"> |
| | | <span class="controls"> |
| | | <span><input type="button" value="List Files" onclick="call_test_function('test_list_files')"></span> |
| | | <span><input type="button" value="End Demo" onclick="call_test_function('test_demo_end')"></span> |
| | | <span><input type="button" value="Fetch from Cloud" onclick="fetch_from_cloud()"></span> |
| | | <span><input type="button" value="Push to Cloud" onclick="push_to_cloud()"></span> |
| | | <span><input type="button" value="Populate local data" onclick="populate_user_data()"></span> |
| | |
| | | HUMBLE_API.configure({ |
| | | applicationtoken: 'deadbeef', |
| | | buildCacheKey: function(path) { |
| | | return path; |
| | | return { path: path, scope: this.options.applicationtoken }; |
| | | }, |
| | | playerSize: function() { |
| | | return { |
| | | width: 800, height: 600, locked: true |
| | | } |
| | | }, |
| | | demoEndedCallback: function() { |
| | | alert('We be done'); |
| | | } |
| | | }); |
| | | }); |