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

mousemove_prevent_default_action.tentative.html unnecessarily listens for selectionchange events when asserting dragstart is fired #42471

Merged

Conversation

aprotyas
Copy link
Member

Since the two subtests in mousemove_prevent_default_action.tentative.html assert that either a selectionchange or a dragstart event is fired on a cancelled mousemove event by comparing a set of logged events (obtained from respective event listeners) against a static set of expected events, it is important to not listen for events a subtest does not care about, as that may produce an unnecessary test failure.

For example, we should not care whether or not a selectionchange event was fired in the second subtest, since we only want to assert that a dragstart event fires from a cancelled mousemove event on a draggable element. These two events are not mutually exclusive in any manner relevant to this WPT.

Thus, this commit makes sure we follow the invariant of listening only for selectionchange events, and not also dragstart events, in the first subtest, and similarly listening only for dragstart events, and not also selectionchange events, in the second subtest.

This PR implements the test change proposed in web-platform-tests/interop#576.

@aprotyas
Copy link
Member Author

cc @mustaqahmed as you had originally authored the test. Thanks!

… for selectionchange events when asserting dragstart is fired

Since the two subtests in
mousemove_prevent_default_action.tentative.html assert that either a
selectionchange or a dragstart event is fired on a cancelled
mousemove event by comparing a set of logged events (obtained from
respective event listeners) against a static set of expected events, it
is important to not listen for events a subtest does not care about, as
that may produce an unnecessary test failure.

For example, we should not care whether or not a selectionchange event
was fired in the second subtest, since we only want to assert that a
dragstart event fires from a cancelled mousemove event on a draggable
element. These two events are not mutually exclusive in any manner
relevant to this WPT.

Thus, this commit makes sure we follow the invariant of listening only
for selectionchange events, and not also dragstart events, in the first
subtest, and similarly listening only for dragstart events, and not also
selectionchange events, in the second subtest.

Signed-off-by: Abrar Rahman Protyasha <a_protyasha@apple.com>
@aprotyas aprotyas force-pushed the interop_test_change_proposal_576 branch from 2fa170b to aa9357a Compare October 11, 2023 19:01
Copy link
Member

@mustaqahmed mustaqahmed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for spotting and fixing the test.

@aprotyas aprotyas merged commit 08b5fe9 into web-platform-tests:master Oct 11, 2023
19 checks passed
@aprotyas aprotyas deleted the interop_test_change_proposal_576 branch October 11, 2023 22:02
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.

4 participants