Closed Bug 1611021 Opened 1 month ago Closed 1 month ago

Add content testing API to simulate media control key events

Categories

(Core :: Audio/Video: Playback, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Although we already have ChromeUtils.generateMediaControlKeysTestEvent() which can be used to generate events, but that can only be used in the scope with chrome privilege.

We would like to have a testing API which can be used easily in mochitest without having privilege.

It allows us to simulate media control key events in non-privileged context, such as a mochitest running in content process.

It allows us to share the same event name when write testing code like following,

const action = "previoustrack";
mediaSession.setActionHandler(action, () => { ... });
specialPower.generateMediaControlKeyTestEvent(action);
Attachment #9122537 - Attachment description: Bug 1611021 - part2 : align some of events' name in MediaControlKeysTestEvent with MediaSessionAction's action name. → Bug 1611021 - part2 : align some event names in MediaControlKeysTestEvent with MediaSessionAction's action name.
Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/18140597bc1b
part1 : add a method in special power to generate media control key events. r=bzbarsky
https://hg.mozilla.org/integration/autoland/rev/4255fea71217
part2 : align some event names in MediaControlKeysTestEvent with MediaSessionAction's action name. r=bzbarsky
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
You need to log in before you can comment on or make changes to this bug.