Skip to content

Commit 18742f5

Browse files
blu25chromium-wpt-export-bot
authored andcommitted
RenderDocument: Fix pointerevent_touch-adjustment_click_target.html.
The test is failing on headless tests with RenderDocument enabled. This is happening because the initial navigation causes a RFH swap that then results in a synthetic mouse move event being fired (that does not happen if the RFH is not swapped). This synthetic mouse event happens before the page is loaded (i.e. before the "load" event is fired). This CL fixes the test by waiting for the "load" event before adding the various event listeners for the touch/pointer events. Bug: 432385247, 40615943 Change-Id: I22d23ebf2063cb488146b2ee8ae784079cf42dad Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6824135 Commit-Queue: Liam Brady <[email protected]> Reviewed-by: Alex Moshchuk <[email protected]> Cr-Commit-Position: refs/heads/main@{#1498358}
1 parent a55e29c commit 18742f5

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

pointerevents/pointerevent_touch-adjustment_click_target.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,13 @@
2626
.send();
2727
}
2828

29-
30-
addEventListener('load', () => {
31-
input_gesture = inject_input();
32-
});
33-
34-
async_test(t => {
29+
promise_test(async t => {
3530
const link = document.getElementById('link');
3631
const expectedEventLog = ['pointerdown-link', 'touchstart-link', 'pointerup-link', 'touchend-link', 'click-link'];
3732
const eventLogRecorder = [];
3833

34+
await new Promise(resolve => addEventListener("load", resolve));
35+
3936
const eventNames = ['touchstart', 'touchmove', 'touchend', 'pointerdown', 'pointermove', 'pointerup', 'click'];
4037
for (eventName of eventNames) {
4138
document.addEventListener(eventName, t.step_func(event => {
@@ -63,5 +60,6 @@
6360
}
6461
}));
6562
}
63+
input_gesture = inject_input();
6664
});
6765
</script>

0 commit comments

Comments
 (0)