You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes failures in the `FocusOriginMonitor` tests on IE, if the browser is in focus. The issue comes from the fact that IE will trigger the `focus` handlers asynchronously, whereas other browsers are synchronous. Here's an example log:
```
IE 11.0.0 (Windows 10 0.0.0) LOG: 'dispatching events'
IE 11.0.0 (Windows 10 0.0.0) LOG: 'making assertions'
IE 11.0.0 (Windows 10 0.0.0) LOG: 'focus event fired'
-----------------------------------------------------------
Chrome 59.0.3071 (Windows 10 0.0.0) LOG: 'dispatching events'
Chrome 59.0.3071 (Windows 10 0.0.0) LOG: 'focus event fired'
Chrome 59.0.3071 (Windows 10 0.0.0) LOG: 'making assertions'
```
The issue only happens when the browser is focused, because the `patchElementFocus` function will override the native `focus` method with a synchronous one only if the browser is **not** focused. These changes make it so the native event is always overwritten, in order to make the tests a little more predictable. Also switches all the tests from `async` to `fakeAsync` to avoid using `setTimeout` in tests.
0 commit comments