Open Bug 1593811 Opened 7 months ago Updated 7 months ago

BrowserTestUtils.waitForContentEvent: improve checkFn error handling

Categories

(Core :: DOM: Content Processes, task, P1)

task

Tracking

()

People

(Reporter: kashav, Unassigned)

References

Details

As of bug 1588193, BrowserTestUtils.waitForContentEvent no longer rejects the returned promise in the case of a checkFn exception. Instead, the checkFn error is thrown in the event listener that was created by ContentEventListenerChild [1].

It may be useful to keep this old error handling behavior, but we'll likely need to rewrite BrowserTestUtils.addContentEventListener to use the sandbox stuff that SpecialPowers.spawn uses [2] to make that possible.

[1] https://searchfox.org/mozilla-central/rev/3300072e993ae05d50d5c63d815260367eaf9179/testing/mochitest/BrowserTestUtils/ContentEventListenerChild.jsm#141-148.

[2] https://searchfox.org/mozilla-central/rev/3300072e993ae05d50d5c63d815260367eaf9179/testing/specialpowers/content/SpecialPowersChild.jsm#1669-1708 (suggested by kmag: https://mozilla.logbot.info/domfission/20191104#c16735827)

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