Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit d328e57

Browse files
Jacob DeWittchromium-wpt-export-bot
authored andcommitted
Update tests to check XRInputSource profiles + gamepad.id
Per the latest WebXR spec, XRInputSource.gamepad.id must be the empty string. Update the browser and layout tests to actually check this. Also update the browser tests that run on Windows to check the profiles array contents against expected values for WMR and OpenVR. Bug: 989114, 942201 Change-Id: I36dff42cff55728d5d90384623623ea871d3a13e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1742439 Commit-Queue: Jacob DeWitt <[email protected]> Reviewed-by: Brian Sheedy <[email protected]> Cr-Commit-Position: refs/heads/master@{#685270}
1 parent 9c17374 commit d328e57

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

webxr/xrInputSource_gamepad_disconnect.https.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
"Expect to have a gamepad, iteration: " + inputChangeEvents);
7878
assert_equals(cached_input_source.gamepad.index, -1,
7979
"WebXR Gamepad.index must be -1, iteration: " + inputChangeEvents);
80+
assert_equals(cached_input_source.gamepad.id, "",
81+
"WebXR Gamepad.id must be empty string, iteration: " + inputChangeEvents);
8082
assert_true(cached_input_source.gamepad.connected,
8183
"Expect the gamepad to be connected, iteration: " + inputChangeEvents);
8284
}
@@ -88,6 +90,8 @@
8890
"Expect to have a gamepad on cached_input_source, iteration: " + inputChangeEvents);
8991
assert_equals(cached_input_source.gamepad.index, -1,
9092
"WebXR Gamepad.index must be -1, iteration: " + inputChangeEvents);
93+
assert_equals(cached_input_source.gamepad.id, "",
94+
"WebXR Gamepad.id must be empty string, iteration: " + inputChangeEvents);
9195
assert_false(cached_input_source.gamepad.connected,
9296
"Expect cached gamepad to be disconnected, iteration: " + inputChangeEvents);
9397
}

webxr/xrInputSource_gamepad_input_registered.https.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@
5252
function assertSameObjects() {
5353
assert_equals(session.inputSources[0], cached_input_source);
5454
assert_equals(cached_input_source.gamepad, cached_gamepad);
55+
56+
// Also make sure that WebXR gamepads have the index and id values required
57+
// by the spec.
5558
assert_equals(cached_gamepad.index, -1);
59+
assert_equals(cached_gamepad.id, "");
5660
}
5761

5862
// Input events and gamepad state changes (button presses, axis movements)
@@ -74,6 +78,7 @@
7478
cached_gamepad = cached_input_source.gamepad;
7579
t.step(() => {
7680
assert_equals(cached_gamepad.index, -1);
81+
assert_equals(cached_gamepad.id, "");
7782
assert_equals(cached_gamepad.buttons.length, 3);
7883
assert_equals(cached_gamepad.axes.length, 2);
7984
// Initially, the button should not be pressed and the axes values should

0 commit comments

Comments
 (0)