Closed Bug 1574296 Opened 2 years ago Closed 2 years ago

Support assertions in nested SpecialPowers.spawn calls

Categories

(Testing :: Mochitest, task)

Version 3
task
Not set
normal

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.

https://hg.mozilla.org/integration/mozilla-inbound/rev/41b6d03a870caa7c4be2146ce8c8d84efdb20e79
Bug 1574296: Support assertions in nested SpecialPowers.span calls. r=mccr8
Flags: needinfo?(kmaglione+bmo)
https://hg.mozilla.org/integration/mozilla-inbound/rev/1f836a6215abeb7a22c4225b4967bc8326cf6bb9
Bug 1574296: Support assertions in nested SpecialPowers.span calls. r=mccr8
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.