diff options
| author | Stephen Blott | 2016-03-29 14:57:40 +0100 | 
|---|---|---|
| committer | Stephen Blott | 2016-03-29 14:57:40 +0100 | 
| commit | 3b72ced87f4dc6402f4ab8f8dbf2873e9a53093d (patch) | |
| tree | c28d0d3966c809f1c474bf5faea7f06783f52e9d /tests | |
| parent | 824477a9c7472ffb1cf9c7d828cbed39abb3c90c (diff) | |
| download | vimium-3b72ced87f4dc6402f4ab8f8dbf2873e9a53093d.tar.bz2 | |
Ensure window has focus in tests.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/dom_tests/dom_tests.coffee | 4 | 
1 files changed, 3 insertions, 1 deletions
| diff --git a/tests/dom_tests/dom_tests.coffee b/tests/dom_tests/dom_tests.coffee index 0dd6e122..c3bdb9c5 100644 --- a/tests/dom_tests/dom_tests.coffee +++ b/tests/dom_tests/dom_tests.coffee @@ -31,8 +31,10 @@ for type in [ "keydown", "keypress", "keyup" ]  commandName = commandCount = null -# Some tests have side effects on the handler stack and the active mode, so these are reset on setup. +# Some tests have side effects on the handler stack and the active mode, so these are reset on setup.  Also, +# some tests affect the focus (e.g. Vomnibar tests), so we make sure the window has the focus.  initializeModeState = -> +  window.focus()    Mode.reset()    handlerStack.reset()    normalMode = installModes() | 
