Skip to content
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

Merged
merged 2 commits into from Jan 22, 2020

Conversation

shvaikalesh
Copy link
Member

@shvaikalesh shvaikalesh commented Jan 15, 2020


return promise_rejects_exactly(t, error, uncaught_error_test(t, listener));
return promise_rejects_exactly(t, error,
Copy link
Member Author

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));
Copy link
Member Author

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"));
Copy link
Member Author

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.

@zcorpan zcorpan merged commit 3d6cd8f into web-platform-tests:master Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants