New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix and refactor some "handleEvent" tests #21186
Fix and refactor some "handleEvent" tests #21186
Conversation
|
||
return promise_rejects_exactly(t, error, uncaught_error_test(t, listener)); | ||
return promise_rejects_exactly(t, error, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is timing out in WebKit (and blocking subsequent tests from executing) because "error"
event is emitted on <iframe>
's window
, so I am adding waitForChangesReported
as EventWatcher
's timeout function.
}, "rethrows errors when getting handleEvent"); | ||
|
||
promise_test(t => { | ||
const listener = { handleEvent: null }; | ||
return promise_rejects(t, new TypeError(), uncaught_error_test(t, listener)); | ||
return promise_rejects(t, new TypeError(), uncaught_error_test(t, () => false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was false positive in WebKit: TypeError
was thrown because argument of addListener
was not a function, and not due to value of handleEvent
as this test expects, so I am adding assert_equals(calls,
check to make sure it is looked up.
}, "throws if handleEvent is falsy and not callable"); | ||
|
||
promise_test(t => { | ||
const listener = { handleEvent: "str" }; | ||
return promise_rejects(t, new TypeError(), uncaught_error_test(t, listener)); | ||
return promise_rejects(t, new TypeError(), uncaught_error_test(t, () => "str")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was false positive in WebKit: TypeError
was thrown because argument of addListener
was not a function, and not due to value of handleEvent
as this test expects, so I am adding assert_equals(calls,
check to make sure it is looked up.
dcbcdaa
to
6796d47
Compare
WebKit issue: MediaQueryList should extend EventTarget.
Follow-up of #15105 and #20401.
//cc @zcorpan @emilio