Bo PTAL InputTransferHandler and transfer_input_to_viz_result.h
Matt PTAL CompositorView
Michael PTAL enums.xml
Brian PTAL WebXrInputTransferTest
Aman Please review all.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
CriteriaHelper.pollInstrumentationThread(
() -> {
Criteria.checkThat(
mScrollOffsetY, Matchers.greaterThan(initialScrollOffset));
});
CriteriaHelper.pollInstrumentationThread(
() -> {
Criteria.checkThat(
mLastSeenEventAction, Matchers.equalTo(MotionEvent.ACTION_CANCEL));
});Is it safe to assume that once we get the `ACTION_CANCEL` event action, the scroll offset should have updated? If so, we could probably swap the order and made the scroll check a single assert instead of a poll?
CriteriaHelper.pollInstrumentationThread(
() -> {
int numFrames =
Integer.parseInt(
mWebXrArTestFramework.runJavaScriptOrFail(
"window.numFramesWithInput",
WebXrArTestFramework.POLL_TIMEOUT_SHORT_MS));
Criteria.checkThat(numFrames, Matchers.greaterThanOrEqualTo(1));
});Nit: Could be shorter by using `pollJavaScriptBooleanOrFail()` and checking `window.numFramesWithInput >= 1`
CriteriaHelper.pollInstrumentationThread(
() -> {
int numSelects =
Integer.parseInt(
mWebXrArTestFramework.runJavaScriptOrFail(
"window.numSelectEvents",
WebXrArTestFramework.POLL_TIMEOUT_SHORT_MS));
Criteria.checkThat(numSelects, Matchers.equalTo(1));
});Ditto.
CriteriaHelper.pollInstrumentationThread(I don't think polling does anything here since we're checking that something didn't happen instead of waiting until something happens.
CriteriaHelper.pollInstrumentationThread(Ditto.
performScrollAndCheckTransfer(true);
// 2. During session: input should NOT be transferred to Viz.
mWebXrArTestFramework.enterSessionWithUserGestureOrFail();
performScrollAndCheckTransfer(false);
// 3. After session: input should be transferred to Viz.
mWebXrArTestFramework.endSession();
performScrollAndCheckTransfer(true);Is there a need to ensure that input has settled between these three steps?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Overall, the logic for blocking input transfer to Viz during WebXR/AR sessions looks solid and well-integrated. The new test provides good coverage for the expected behavior.
I have a few observations and questions:
**InputTransferHandler.java**
The check in `canTransferInputToViz` is straightforward and correctly uses the new `mIsInXr` state.
**Metrics**
The addition of `XrIsActive` to `TransferInputToVizResult` and `enums.xml` is correct.
Thanks Alex, conceptually SGTM, added a couple of small things.
assert (handler != null);Nit: parentheses here are redundant, `assert handler != null;`
public void setOverlayVrMode(boolean enabled) {Do we also want to update `InputTransferHandler` in this case?
if (expectTransfer) {Can we check if WebXR did not get any input frames here? Maybe reset the JS counters on line 110 irrespective of `!expectTransfer` and assert numFrames==0 here?
performScrollAndCheckTransfer(true);nit: `/*expectTransfer=*/ true`, same at other places
kXrIsActive = 17,Can you please add a TODO here about investigating InputEventObserver potentially, maybe file a bug?
| Code-Review | +1 |
histograms lgtm
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Side question.. was this AI generated review?
https://chromium-review.googlesource.com/c/chromium/src/+/7552845/3#message-dbd4a064dffb85b867840244f73d9d896c0f37ea
Weird interface that it's not a comment and no way to reply to it or anything..
public void setOverlayVrMode(boolean enabled) {Do we also want to update `InputTransferHandler` in this case?
+1
public class InputTransferHandler implements WindowAndroid.SelectionHandlesObserver {hmm... this is a lot of implementation in the content public API
oh and content bits lgtm, I guess
| Code-Review | +1 |
CompositorView lgtm
Side question.. was this AI generated review?
https://chromium-review.googlesource.com/c/chromium/src/+/7552845/3#message-dbd4a064dffb85b867840244f73d9d896c0f37eaWeird interface that it's not a comment and no way to reply to it or anything..
Yes, this was gemini-cli generated comment, was trying to see how good it is. Was running it in YOLO mode, lesson learned :P
| Commit-Queue | +1 |
Nit: parentheses here are redundant, `assert handler != null;`
Done
public void setOverlayVrMode(boolean enabled) {Bo LiuDo we also want to update `InputTransferHandler` in this case?
+1
I don't think VR needs it because it's input needs are different, but I think given the need to put the logic in `surfaceChanged` it's probably cleaner to do so.
I've created a helper method to minimize the duplication between the two methods, but I'm not enamored of the name if you have a better suggestion.
Can we check if WebXR did not get any input frames here? Maybe reset the JS counters on line 110 irrespective of `!expectTransfer` and assert numFrames==0 here?
I don't think that's necessary. We do other checks outside of this that should be sufficient to validate if we are in a WebXR session or not.
CriteriaHelper.pollInstrumentationThread(
() -> {
Criteria.checkThat(
mScrollOffsetY, Matchers.greaterThan(initialScrollOffset));
});
CriteriaHelper.pollInstrumentationThread(
() -> {
Criteria.checkThat(
mLastSeenEventAction, Matchers.equalTo(MotionEvent.ACTION_CANCEL));
});Is it safe to assume that once we get the `ACTION_CANCEL` event action, the scroll offset should have updated? If so, we could probably swap the order and made the scroll check a single assert instead of a poll?
Done
CriteriaHelper.pollInstrumentationThread(
() -> {
int numFrames =
Integer.parseInt(
mWebXrArTestFramework.runJavaScriptOrFail(
"window.numFramesWithInput",
WebXrArTestFramework.POLL_TIMEOUT_SHORT_MS));
Criteria.checkThat(numFrames, Matchers.greaterThanOrEqualTo(1));
});Nit: Could be shorter by using `pollJavaScriptBooleanOrFail()` and checking `window.numFramesWithInput >= 1`
Done
CriteriaHelper.pollInstrumentationThread(
() -> {
int numSelects =
Integer.parseInt(
mWebXrArTestFramework.runJavaScriptOrFail(
"window.numSelectEvents",
WebXrArTestFramework.POLL_TIMEOUT_SHORT_MS));
Criteria.checkThat(numSelects, Matchers.equalTo(1));
});Alexander CooperDitto.
Done
I don't think polling does anything here since we're checking that something didn't happen instead of waiting until something happens.
Done
CriteriaHelper.pollInstrumentationThread(Alexander CooperDitto.
Done
nit: `/*expectTransfer=*/ true`, same at other places
Done
performScrollAndCheckTransfer(true);
// 2. During session: input should NOT be transferred to Viz.
mWebXrArTestFramework.enterSessionWithUserGestureOrFail();
performScrollAndCheckTransfer(false);
// 3. After session: input should be transferred to Viz.
mWebXrArTestFramework.endSession();
performScrollAndCheckTransfer(true);Is there a need to ensure that input has settled between these three steps?
I don't think so. I think once the Transfer check is done it's okay to exit, plus we wait on the change in Xr state anyways, which should be sufficient to ensure things have settled down? LMK if you disagree though.
Can you please add a TODO here about investigating InputEventObserver potentially, maybe file a bug?
Done: crbug.com/483269973
I'll note though that I'm not sure we'll see similar input improvements in Xr mode though to make it worth it, up to you how time intensive it will be to investigate.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
public void setOverlayVrMode(boolean enabled) {Bo LiuDo we also want to update `InputTransferHandler` in this case?
Alexander Cooper+1
I don't think VR needs it because it's input needs are different, but I think given the need to put the logic in `surfaceChanged` it's probably cleaner to do so.
I've created a helper method to minimize the duplication between the two methods, but I'm not enamored of the name if you have a better suggestion.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
Test code LGTM
Plumb Xr Status into InputTransferHandler
Configures the InputTransferHandler to be aware of WebXR sessions, which
should not have their input transferred to viz, because doing so blocks
any processing within the WebXR session.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |