Change Gamepad testing to function more like platform monitor code
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
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.
Assignee | ||
Comment 1•5 years ago
|
||
The "pending events" functionality is going to be taken by the test channel
itself, so this code is no longer needed
Assignee | ||
Comment 2•5 years ago
|
||
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
Assignee | ||
Comment 3•5 years ago
|
||
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
Comment 5•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a1b892fa5d21
https://hg.mozilla.org/mozilla-central/rev/ed5c70dc6a6c
https://hg.mozilla.org/mozilla-central/rev/b7881b750473
Description
•