Fix tests broken by undefined `window` references in ReactEventListener.

This test breakage blames to e1c2d02fddb40cb0b246d2c2da97b41b6ba378bc.
Merge pull request #1710 from benjamn/fix-tests-broken-by-undefined-window-references

Fix tests broken by undefined `window` references in ReactEventListener.