Commit dc893b38 authored by Jacob DeWitt's avatar Jacob DeWitt Committed by Commit Bot

Update XRInputSource.profiles values to match latest registry

Generic profiles are format "generic-trigger-grip-touchpad-thumbstick"
instead of "grip-touchpad-thumbstick-controller".

There are also some other slight profile name changes.

Bug: 992631
Change-Id: Ic71f0db0e3a8c6dbc9003a045a6ce300ec01b180
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808157Reviewed-by: default avatarTibor Goldschwendt <tiborg@chromium.org>
Reviewed-by: default avatarAlexander Cooper <alcooper@chromium.org>
Commit-Queue: Jacob DeWitt <jacde@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697247}
parent 2f27c318
......@@ -186,7 +186,7 @@ device::mojom::XRInputSourceStatePtr GvrInputDelegate::GetInputSourceState() {
controller_->GetRelativePointerTransform(&pointer);
state->description->pointer_offset = pointer;
state->description->profiles.push_back("daydream-controller");
state->description->profiles.push_back("google-daydream");
// This Gamepad data is used to expose touchpad position to WebXR.
state->gamepad = CreateGamepad(controller_->GetGamepadData());
......
......@@ -557,10 +557,12 @@ IN_PROC_MULTI_CLASS_BROWSER_TEST_F2(WebXrVrOpenVrBrowserTest,
// only supports that type of controller and fills in default values if
// those inputs don't exist.
VerifyInputSourceProfilesArray(
t, {"windows-mixed-reality", "grip-touchpad-thumbstick-controller"});
t,
{"windows-mixed-reality", "generic-trigger-grip-touchpad-thumbstick"});
} else if (t->GetRuntimeType() ==
XrBrowserTestBase::RuntimeType::RUNTIME_OPENVR) {
VerifyInputSourceProfilesArray(t, {"test-value-test-value", "controller"});
VerifyInputSourceProfilesArray(
t, {"test-value-test-value", "generic-trigger"});
}
t->RunJavaScriptOrFail("done()");
......@@ -631,10 +633,12 @@ IN_PROC_MULTI_CLASS_BROWSER_TEST_F2(WebXrVrOpenVrBrowserTest,
// only supports that type of controller and fills in default values if
// those inputs don't exist.
VerifyInputSourceProfilesArray(
t, {"windows-mixed-reality", "grip-touchpad-thumbstick-controller"});
t,
{"windows-mixed-reality", "generic-trigger-grip-touchpad-thumbstick"});
} else if (t->GetRuntimeType() ==
XrBrowserTestBase::RuntimeType::RUNTIME_OPENVR) {
VerifyInputSourceProfilesArray(t, {"test-value-test-value", "controller"});
VerifyInputSourceProfilesArray(
t, {"test-value-test-value", "generic-trigger"});
}
t->RunJavaScriptOrFail("done()");
......@@ -734,11 +738,13 @@ IN_PROC_MULTI_CLASS_BROWSER_TEST_F2(WebXrVrOpenVrBrowserTest,
// only supports that type of controller and fills in default values if
// those inputs don't exist.
VerifyInputSourceProfilesArray(
t, {"windows-mixed-reality", "grip-touchpad-thumbstick-controller"});
t,
{"windows-mixed-reality", "generic-trigger-grip-touchpad-thumbstick"});
} else if (t->GetRuntimeType() ==
XrBrowserTestBase::RuntimeType::RUNTIME_OPENVR) {
VerifyInputSourceProfilesArray(
t, {"test-value-test-value", "grip-touchpad-thumbstick-controller"});
t,
{"test-value-test-value", "generic-trigger-grip-touchpad-thumbstick"});
}
t->RunJavaScriptOrFail("done()");
......@@ -854,7 +860,7 @@ IN_PROC_BROWSER_TEST_F(WebXrVrOpenVrBrowserTest, TestGamepadReservedData) {
kPollTimeoutShort);
VerifyInputSourceProfilesArray(
this, {"test-value-test-value", "touchpad-controller"});
this, {"test-value-test-value", "generic-trigger-touchpad"});
RunJavaScriptOrFail("done()");
EndTest();
......@@ -897,7 +903,7 @@ IN_PROC_BROWSER_TEST_F(WebXrVrOpenVrBrowserTest, TestGamepadOptionalData) {
PollJavaScriptBooleanOrFail("isButtonCountEqualTo(3)", kPollTimeoutShort);
VerifyInputSourceProfilesArray(
this, {"test-value-test-value", "grip-touchpad-controller"});
this, {"test-value-test-value", "generic-trigger-grip-touchpad"});
RunJavaScriptOrFail("done()");
EndTest();
......
......@@ -368,7 +368,7 @@ device::mojom::XRInputSourceStatePtr OculusRenderLoop::GetTouchData(
// The absence of "touchpad" in this string indicates that the slots in the
// button and axes arrays are placeholders required by the xr-standard mapping
// but not actually updated with any input.
desc->profiles.push_back("grip-thumbstick-controller");
desc->profiles.push_back("generic-trigger-grip-thumbstick");
state->description = std::move(desc);
......
......@@ -351,18 +351,18 @@ class OpenVRGamepadBuilder : public XRStandardGamepadBuilder {
profiles_.push_back(name);
// Also record information about what this controller actually does in a
// more general sense.
std::string capabilities = "";
// more general sense. The controller is guaranteed to at least have a
// trigger if we get here.
std::string capabilities = "generic-trigger";
if (HasSecondaryButton()) {
capabilities += "grip-";
capabilities += "-grip";
}
if (HasTouchpad()) {
capabilities += "touchpad-";
capabilities += "-touchpad";
}
if (HasThumbstick()) {
capabilities += "thumbstick-";
capabilities += "-thumbstick";
}
capabilities += "controller";
profiles_.push_back(capabilities);
}
......
......@@ -575,7 +575,7 @@ ParsedInputState MixedRealityInputHelper::ParseWindowsSourceState(
// This makes it clear that the controller actually has a grip button and
// touchpad and thumbstick input. Otherwise, it's ambiguous whether slots
// like the touchpad buttons + axes are hooked up vs just placeholders.
description->profiles.push_back("grip-touchpad-thumbstick-controller");
description->profiles.push_back("generic-trigger-grip-touchpad-thumbstick");
source_state->gamepad = GetWebXRGamepad(input_state);
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment