Closed Bug 1933631 Opened 1 year ago Closed 1 year ago

browser tests: Propagate task function name in addAccessibleTask

Categories

(Core :: Disability Access APIs, task)

task

Tracking

()

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

Details

Attachments

(1 file)

When you add a task in a browser test, you can give it a name:
add_task(async function testTabStopsNoPageWithHomeButton() {
When you do this, it shows up in the test run output:
0:17.90 INFO Entering test bound testTabStopsNoPageWithHomeButton
For a11y tests, we use addAccessibleTask:

addAccessibleTask(`...`, async function testProtected(browser, docAcc) {

But that doesn't propagate the name:
0:39.16 INFO Entering test bound
This makes it more time consuming to figure out which test you're dealing with if the test doesn't specifically output some identifying info. The task function name should be propagated so that this works.

For a11y browser tests, we use addAccessibleTask:

addAccessibleTask(`...`, async function testProtected(browser, docAcc) {

Previously, the task function name (e.g. testProtected) didn't appear in test run output:

0:39.16 INFO Entering test bound

Even though the function is named, addAccessibleTask wraps it in an anonymous function, so the test harness can't get the original name.
This patch overrides the name of the wrapper function to match the name of the supplied task function, resulting in test run output like this:

0:39.16 INFO Entering test bound testProtected

This should make it easier to determine what test you're dealing with when examining test run output.

Pushed by jteh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cf80c76b3107 Propagate the name of the task function passed to addAccessibleTask in browser tests. r=nlapre
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
Blocks: 1974927
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: