Test that window.onerror is called on window object for events created using new ErrorEvent('error', {}).