Closed Bug 1658416 Opened 5 years ago Closed 5 years ago

Change Gamepad testing to function more like platform monitor code

Categories

(Core :: DOM: Device Interfaces, defect)

defect

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: cmartin, Assigned: cmartin)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Currently, the GamepadTestChannel immediately calls into GamepadPlatformService when it receives a message, but that goes against the way that GamepadPlatformService was designed - It doesn't really expect to receive messages until a GamepadEventChannel is created and monitoring is started.

We should change GamepadTestChannel to wait until monitoring starts to allow simulated events to flow, and block them after monitoring stops.

Blocks: 1658419

The "pending events" functionality is going to be taken by the test channel
itself, so this code is no longer needed

Each existing GamepadTestChannel needs to know when gamepad monitoring is
started or stopped so it knows whether it's safe to deliver messages.

Depends on D86746

Since the test code will be waiting on a promise from the addGamepad message,
we can simply defer fulfilling the promise until monitoring starts if it
hasn't already.

Since every other message relies on the index given by the fulfilled promise,
it ensures that we won't get any simulated events until monitoring starts

Depends on D86747

Pushed by cmartin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a1b892fa5d21 Remove current pending events handling r=baku https://hg.mozilla.org/integration/autoland/rev/ed5c70dc6a6c Allow gamepad test channel to observe gamepad monitoring state r=handyman https://hg.mozilla.org/integration/autoland/rev/b7881b750473 Defer simulated gamepad adds until monitoring starts r=handyman
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: