mousemove_prevent_default_action.tentative.html unnecessarily listens for selectionchange events when asserting dragstart is fired #42471
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.