Closed Bug 1574296 Opened 2 months ago Closed 2 months ago

Support assertions in nested SpecialPowers.spawn calls

Categories

(Testing :: Mochitest, task)

Version 3
task
Not set

Tracking

(firefox70 fixed)

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: kmag, Assigned: kmag)

References

Details

Attachments

(1 file)

SpecialPowers.spawn callbacks have helpers which automatically proxy calls of Assert methods back to the scope which called spawn. Unfortunately, this only works when the caller scope has a working SimpleTest harness. In particular, this means that it does not work for nested SpecialPowers.spawn calls, where it would be particularly useful.

Prior to this patch, assertions in SpecialPowers.spawn callbacks only work
when the caller was in a window with a SimpleTest harness.

This patch fixes that by registering a default assertion handler at the start
of a test, and sending assertions from any task without its own harness to
said default handler.

Flags: needinfo?(kmaglione+bmo)
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.