Open Bug 1892091 Opened 5 months ago Updated 5 months ago

Resolve intermittent failures and replace `link.click()` with `EventUtils.synthesizeMouseAtCenter` in Bounce Tracking Protection test helper

Categories

(Core :: Privacy: Anti-Tracking, task, P3)

task

Tracking

()

People

(Reporter: pbz, Unassigned)

References

(Blocks 1 open bug)

Details

Due to intermittent test failures I switched from synthesizeMouse to running .click() in the <a> element + a test helper for user activation. This isn't ideal since it doesn't behave the same way as a real user click would. synthesizeMouseAtCenter is a much better fit.

The intermittent test failures mostly appeared in browser_bouncetracking_stateful_storage.js and browser_bouncetracking_stateful_cookies.js on Windows and Linux. The click would not go through in some of the --verify runs. From debugging it looks like the <a> element isn't hit though it sometimes hits the document or the body element. :mconley suggested it might be Bug 1743857 where we race the SpecialPowers.spawn call and the click call. It's also possible that layout hasn't happened yet when we try to click. I did ensure that the page is fully loaded before injecting the element.

Code snippet from the intermittently failing test helper: https://gist.github.com/Trikolon/6576f76e2c642c4adcea4a43fedafdd6
Failure log: https://treeherder.mozilla.org/logviewer?job_id=454874029&repo=try&lineNumber=9370

You need to log in before you can comment on or make changes to this bug.