aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dom_tests/phantom_runner.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dom_tests/phantom_runner.coffee')
-rw-r--r--tests/dom_tests/phantom_runner.coffee12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/dom_tests/phantom_runner.coffee b/tests/dom_tests/phantom_runner.coffee
index d05d9ab4..93218724 100644
--- a/tests/dom_tests/phantom_runner.coffee
+++ b/tests/dom_tests/phantom_runner.coffee
@@ -14,13 +14,23 @@ page.onConsoleMessage = (msg) ->
console.log msg
page.onError = (msg, trace) ->
- console.log(msg);
+ console.log(msg)
trace.forEach (item) ->
console.log(' ', item.file, ':', item.line)
page.onResourceError = (resourceError) ->
console.log(resourceError.errorString)
+page.onCallback = (request) ->
+ switch request.request
+ when "keyboard"
+ switch request.key
+ when "escape"
+ page.sendEvent "keydown", page.event.key.Escape
+ page.sendEvent "keyup", page.event.key.Escape
+ else
+ page.sendEvent "keypress", request.key
+
testfile = path.join(path.dirname(system.args[0]), 'dom_tests.html')
page.open testfile, (status) ->
if status != 'success'