diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-07-22 19:24:42 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-07-22 19:24:42 -0700 |
commit | 80e012a435b87ea5bdc1493a95b8323fe7b89c4d (patch) | |
tree | a52a4e551edb7fc430a32c47b661afcf2a0f52c3 | |
parent | 3501bc15bf13876d49acb2562a706f013e406c2b (diff) |
test + fix for continuing to load despite bad audios
-rw-r--r-- | src/library.js | 5 | ||||
-rwxr-xr-x | tests/runner.py | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/library.js b/src/library.js index 5ac890d9..8d2c628e 100644 --- a/src/library.js +++ b/src/library.js @@ -306,7 +306,10 @@ LibraryManager.library = { Module['preloadPlugins'].forEach(function(plugin) { if (handled) return; if (plugin['canHandle'](fullname)) { - plugin['handle'](byteArray, fullname, finish, onerror); + plugin['handle'](byteArray, fullname, finish, function() { + if (onerror) onerror(); + removeRunDependency('cp ' + fullname); + }); handled = true; } }); diff --git a/tests/runner.py b/tests/runner.py index 1ad8f3a3..af910b2a 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -7801,10 +7801,11 @@ elif 'browser' in str(sys.argv): def test_sdl_audio(self): shutil.copyfile(path_from_root('tests', 'sounds', 'alarmvictory_1.ogg'), os.path.join(self.get_dir(), 'sound.ogg')) shutil.copyfile(path_from_root('tests', 'sounds', 'alarmcreatemiltaryfoot_1.wav'), os.path.join(self.get_dir(), 'sound2.wav')) + open(os.path.join(self.get_dir(), 'bad.ogg'), 'w').write('I claim to be audio, but am lying') open(os.path.join(self.get_dir(), 'sdl_audio.c'), 'w').write(self.with_report_result(open(path_from_root('tests', 'sdl_audio.c')).read())) # use closure to check for a possible bug with closure minifying away newer Audio() attributes - Popen(['python', EMCC, '-O2', '--minify', '0', os.path.join(self.get_dir(), 'sdl_audio.c'), '--preload-file', 'sound.ogg', '--preload-file', 'sound2.wav', '-o', 'page.html', '-s', 'EXPORTED_FUNCTIONS=["_main", "_play", "_play2"]']).communicate() + Popen(['python', EMCC, '-O2', '--minify', '0', os.path.join(self.get_dir(), 'sdl_audio.c'), '--preload-file', 'sound.ogg', '--preload-file', 'sound2.wav', '--preload-file', 'bad.ogg', '-o', 'page.html', '-s', 'EXPORTED_FUNCTIONS=["_main", "_play", "_play2"]']).communicate() self.run_browser('page.html', '', '/report_result?1') def test_sdl_audio_quickload(self): |