diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-08-12 15:10:06 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-08-12 15:10:06 -0700 |
commit | 8ceb235681031c306b410a147db44088bad0fe1b (patch) | |
tree | 1c3c13898aa7448825fd96c446e1d5d9b9fc6a57 /tests | |
parent | c08d4928829045862bef2169105c91c34d5f400f (diff) |
re-add test_sdl_pumpevents
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_browser.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_browser.py b/tests/test_browser.py index a24a2de4..60c030aa 100644 --- a/tests/test_browser.py +++ b/tests/test_browser.py @@ -787,6 +787,19 @@ Press any key to continue.''' Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'sdl_mouse.c'), '-O2', '--minify', '0', '-o', 'sdl_mouse.js', '--pre-js', 'pre.js']).communicate() self.run_browser('page.html', '', '/report_result?600') + def test_sdl_pumpevents(self): + # key events should be detected using SDL_PumpEvents + open(os.path.join(self.get_dir(), 'pre.js'), 'w').write(''' + function keydown(c) { + var event = document.createEvent("KeyboardEvent"); + event.initKeyEvent("keydown", true, true, window, + 0, 0, 0, 0, + c, c); + document.dispatchEvent(event); + } + ''') + self.btest('sdl_pumpevents.c', expected='3', args=['--pre-js', 'pre.js']) + 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')) |