New issue
Advanced search Search tips

Issue 787878 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug
Proj-XR



Sign in to add a comment

testNfcFiresVrdisplayactivate times out in WebappActivity

Project Member Reported by bsheedy@chromium.org, Nov 22 2017

Issue description

NFC/Daydream View insertion is supposed to work in all the activity types we support, but does not currently in WebappActivity.

To reproduce, change WebVrTransitionTest#testNfcFiresVrdisplayactivate's VrActivityRestriction to be either VrActivityRestriction.SupportedActivity.WAA or VrActivityRestriction.SupportedActivity.ALL, then run the test.
 
Status: Available (was: Untriaged)
This appears to be working with actual webapks. Maybe the bug is in the test infra somehow?
Owner: bsheedy@chromium.org
Status: Assigned (was: Available)
Not out of the question. I'll take a look.
It works fine on my local device, but fails on the swarmed devices.
Logcat output of a failed run is available at https://isolateserver.appspot.com/browse?namespace=default-gzip&digest=d1e7278b9ffb176818028e7e3fe5ffb90d45add0&as=HT73X0204521_20171123T010253, and a post-test screenshot at https://isolateserver.appspot.com/browse?namespace=default-gzip&digest=0c73e9a6d5680d90b280a79f9e425242d20b62e7&as=screenshot.png

What's interesting is that Daydream seems to think that we're already in VR:

Device(HT73X0204521) 11-23 01:04:09.196   990  1638 I ActivityManager: START u0 {act=android.nfc.action.NDEF_DISCOVERED cmp=com.google.vr.vrcore/.nfc.ViewerDetectionActivity (has extras)} from uid 10108 on display 0
...
Device(HT73X0204521) 11-23 01:04:09.313  8116  8116 D LifecycleMonitor: Lifecycle status change: org.chromium.chrome.browser.webapps.WebappActivity0@2c18dbc in: PAUSED
Device(HT73X0204521) 11-23 01:04:09.337  7293  7293 I ViewerDetectionActivity: Nfc debounce time is: 2000 millis.
Device(HT73X0204521) 11-23 01:04:09.337  7293  7293 I ViewerDetectionActivity: Viewer scanned. ID: 3
Device(HT73X0204521) 11-23 01:04:09.340  7293  7293 I DaydreamManagerImpl: Setting viewer: Google, Inc./Daydream View
Device(HT73X0204521) 11-23 01:04:09.345  7293  7293 W DaydreamManagerImpl: Already in VrMode or in Daydream session, not starting intent.
Now that I think about it, it's likely that two NFC tests are being run too quickly in succession, so that the NFC scan from the second test occurs within the debounce timeout (2 seconds) of the last one.
It turns out that's not the issue, at least not by itself. Adding a 2 second sleep at the end of the test to make sure we're not in the debounce timeout didn't change anything. Running the tests locally, it looks like the custom tab and webapp are getting stuck in the DOFF flow, whereas chrome tabbed activity can exit VR normally. Is this expected?
That definitely doesn't sound expected... DOFF flow should work for all 3.
The DOFF issue seems to have been caused by the page listening for vrdisplayactivate, but then not doing anything with it. When it actually presents using the event, everything seems to work fine. We should probably be presenting with it anyways to make sure we autopresent on NFC scan, although I'm not sure why this worked fine in CTA but not the other activity types.
Project Member

Comment 9 by bugdroid1@chromium.org, Nov 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/676a19bd986606f320b252ccb90466f9e491fdf6

commit 676a19bd986606f320b252ccb90466f9e491fdf6
Author: bsheedy <bsheedy@chromium.org>
Date: Tue Nov 28 01:09:00 2017

Fix NFC test not working in WebappActivity

Fixes the issue of CCT/WAA NFC tests getting stuck in the DOFF flow.
This was somehow caused by the webpage listening for vrdisplayactivate,
but not actually presenting with it.

Also adds a sleep at the end of the test to prevent a possible race
condition with VrCore's 2 second NFC debounce timeout.

Bug:  787878 
Change-Id: Ic5f16258cfa94ce3fac63781c1e225b8b2749f4e
Reviewed-on: https://chromium-review.googlesource.com/791938
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519499}
[modify] https://crrev.com/676a19bd986606f320b252ccb90466f9e491fdf6/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTransitionTest.java
[modify] https://crrev.com/676a19bd986606f320b252ccb90466f9e491fdf6/chrome/test/data/android/webvr_instrumentation/html/test_nfc_fires_vrdisplayactivate.html

Status: Fixed (was: Assigned)
Labels: M-64 Test-Complete
Labels: VR-Caught-By-Test
Components: Internals>XR
Labels: -VR-Caught-By-Test XR-Caught-By-Test

Sign in to add a comment