Set useCapture to true when handling keydown events in test windows

Prevents these events from getting intercepted by other handlers.
This commit is contained in:
Nathan Sobo
2015-10-14 15:04:25 -06:00
parent c1d5cdcd64
commit 82cbf01c5b

View File

@@ -17,7 +17,7 @@ try
# that are focused in the very first spec run.
remote.getCurrentWindow().show() unless getWindowLoadSettings().headless
window.addEventListener 'keydown', (event) ->
handleKeydown = (event) ->
# Reload: cmd-r / ctrl-r
if (event.metaKey or event.ctrlKey) and event.keyCode is 82
ipc.send('call-window-method', 'restart')
@@ -30,6 +30,8 @@ try
if (event.metaKey or event.ctrlKey) and event.keyCode is 87
ipc.send('call-window-method', 'close')
window.addEventListener('keydown', handleKeydown, true)
# Add 'exports' to module search path.
exportsPath = path.join(getWindowLoadSettings().resourcePath, 'exports')
require('module').globalPaths.push(exportsPath)