From 3b72ced87f4dc6402f4ab8f8dbf2873e9a53093d Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Tue, 29 Mar 2016 14:57:40 +0100 Subject: Ensure window has focus in tests. --- tests/dom_tests/dom_tests.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests') 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() -- cgit v1.2.3