Implement Input portions of webxr-test-api #17810
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change implements the input related portions of the webxr-test-api
and updates internal tests to use those methods/constants/inits.
Most of the logic is ported from xr-internal-device-mocking.js and just
converted from attributes to a pair of set/clear properties. No tests
were actually using the getters, so those were just deleted. Because
the webxr-test-api does not yet support gamepads, all of that logic was
left in the internal mock.
It also forces/fixes a potential bug where a device with no inputs may
opt to set the "InputStates" value of the mojom to null rather than an
empty array. (The device code typically sets this to an empty array)
Rather than risk losing/confusing the diff to the updated tests, future
work will move these tests to the external WPTs
Bug: 979318
Change-Id: I846831a561217abd66ab841326a5e5472f38afeb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1699505
Reviewed-by: Bill Orr <billorr@chromium.org>
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Cr-Commit-Position: refs/heads/master@{#677061}