New issue
Advanced search Search tips

Issue 904012 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Task
Proj-VR
Proj-XR
Proj-XR-VR

Blocked on:
issue 908917



Sign in to add a comment

Add support for VR render tests

Project Member Reported by bsheedy@chromium.org, Nov 10

Issue description

Currently, we have a few render tests for JavaScript dialogs while in the VR browser since we're able to grab the Android view we're displaying and use render tests normally.

In order to support using render tests for other VR UI such as the VR Browser UI, we'll need to make render tests compatible with VR's frame buffer dumping capabilities since there is no view to point the render test at.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 12

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

commit 3c870ab9d8b126c1e36a27e505e20fd1f03234d8
Author: bsheedy <bsheedy@chromium.org>
Date: Mon Nov 12 21:55:53 2018

Add support for VR frame buffer dumps in render tests

Adds support for using render tests for VR UI through
VR's ability to dump the frame buffer to disk.

We can't use the standard approach of passing
RenderTestRule a View to render since most of the VR UI
is rendered natively using Skia. Instead, we refactor
RenderTestRule slightly to support taking either a
View or a Bitmap, then pass it the Bitmap of the
frame buffer dump.

Bug: 904012

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:linux_vr;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Icebfff58cea4ac8ab29fb4dbadc715d729729eda
Reviewed-on: https://chromium-review.googlesource.com/c/1241471
Reviewed-by: Peter Conn <peconn@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607340}
[modify] https://crrev.com/3c870ab9d8b126c1e36a27e505e20fd1f03234d8/chrome/android/BUILD.gn
[modify] https://crrev.com/3c870ab9d8b126c1e36a27e505e20fd1f03234d8/chrome/android/javatests/src/org/chromium/chrome/browser/vr/VrBrowserDialogTest.java
[modify] https://crrev.com/3c870ab9d8b126c1e36a27e505e20fd1f03234d8/chrome/android/javatests/src/org/chromium/chrome/browser/vr/util/NativeUiUtils.java
[modify] https://crrev.com/3c870ab9d8b126c1e36a27e505e20fd1f03234d8/chrome/browser/vr/ui.cc
[modify] https://crrev.com/3c870ab9d8b126c1e36a27e505e20fd1f03234d8/chrome/browser/vr/ui_test_input.h
[modify] https://crrev.com/3c870ab9d8b126c1e36a27e505e20fd1f03234d8/chrome/test/android/javatests/src/org/chromium/chrome/test/util/RenderTestRule.java
[add] https://crrev.com/3c870ab9d8b126c1e36a27e505e20fd1f03234d8/components/test/data/permission_dialogs/render_tests/VrBrowserDialogTest.microphone_permission_prompt_granted_browser_ui.Pixel_XL-25.png
[add] https://crrev.com/3c870ab9d8b126c1e36a27e505e20fd1f03234d8/components/test/data/permission_dialogs/render_tests/VrBrowserDialogTest.microphone_permission_prompt_granted_browser_ui.Pixel_XL-26.png
[add] https://crrev.com/3c870ab9d8b126c1e36a27e505e20fd1f03234d8/components/test/data/permission_dialogs/render_tests/VrBrowserDialogTest.microphone_permission_prompt_granted_ui.Pixel_2-27.png
[add] https://crrev.com/3c870ab9d8b126c1e36a27e505e20fd1f03234d8/components/test/data/permission_dialogs/render_tests/VrBrowserDialogTest.microphone_permission_prompt_visible_browser_ui.Pixel_XL-25.png
[add] https://crrev.com/3c870ab9d8b126c1e36a27e505e20fd1f03234d8/components/test/data/permission_dialogs/render_tests/VrBrowserDialogTest.microphone_permission_prompt_visible_browser_ui.Pixel_XL-26.png
[add] https://crrev.com/3c870ab9d8b126c1e36a27e505e20fd1f03234d8/components/test/data/permission_dialogs/render_tests/VrBrowserDialogTest.microphone_permission_prompt_visible_ui.Pixel_2-27.png

There appear to be two issues that are causing flakiness with the added test.

#1 is that even though we lock the head pose forward before taking screenshots, we can have tooltips visible or not depending on whether we started facing slightly downward or not. This might be as simple as waiting until they disappear, but will require some testing.

#2 is that GVR gives us a variable size from GetMaximumEffectiveRenderTargetSize even though it should be constant per device type. This doesn't repro when only running the one test or all  the VrBrowserDialogTests, but repros ~90% of the time when running all VR instrumentation tests.

The current theory for #2 is that the system controls are visible at the point where GVR checks the screen size, which might change the virtual screen size a bit.
Project Member

Comment 3 by bugdroid1@chromium.org, Nov 14

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

commit 772c7a3089b644e699f6da11e88d85c0328dea5f
Author: bsheedy <bsheedy@chromium.org>
Date: Wed Nov 14 18:07:47 2018

Short circuit RenderTestRule comparison

Short circuits RenderTestRule's Bitmap comparison if Bitmap.sameAs
returns true. This comparison is signiciantly faster than the fallback
pixel-by-pixel comparison, particularly when comparing large images like
those produced by VR.

Bug: 904012
Change-Id: Ia9cdd91c91f94079d853ec28fd49fee3c3dd0905
Reviewed-on: https://chromium-review.googlesource.com/c/1334945
Reviewed-by: Peter Conn <peconn@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608030}
[modify] https://crrev.com/772c7a3089b644e699f6da11e88d85c0328dea5f/chrome/test/android/javatests/src/org/chromium/chrome/test/util/RenderTestRule.java

Project Member

Comment 4 by bugdroid1@chromium.org, Nov 15

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

commit a9a852ff7cc2323596d82a65e7a8c34586fa53c9
Author: bsheedy <bsheedy@chromium.org>
Date: Thu Nov 15 19:46:32 2018

Update Daydream View headset string

Updates the string used to set the paired viewer to Daydream View during
VR tests. It was getting set to this version anytime an NFC scan
occurred, causing image diff tests to fail depending on which subset of
tests were run due to slightly different render sizes being reported by
VrCore.

TBR=billorr@chromium.org

Bug: 904012
Change-Id: I4ce031ffc0a5fba3abbe59a5d33dff1e5a416885
Reviewed-on: https://chromium-review.googlesource.com/c/1338224
Reviewed-by: Brian Sheedy <bsheedy@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608477}
[modify] https://crrev.com/a9a852ff7cc2323596d82a65e7a8c34586fa53c9/chrome/android/shared_preference_files/test/vr_ddview_skipdon_setupcomplete.json
[modify] https://crrev.com/a9a852ff7cc2323596d82a65e7a8c34586fa53c9/components/test/data/permission_dialogs/render_tests/VrBrowserDialogTest.microphone_permission_prompt_granted_browser_ui.Pixel_XL-25.png
[modify] https://crrev.com/a9a852ff7cc2323596d82a65e7a8c34586fa53c9/components/test/data/permission_dialogs/render_tests/VrBrowserDialogTest.microphone_permission_prompt_granted_browser_ui.Pixel_XL-26.png
[modify] https://crrev.com/a9a852ff7cc2323596d82a65e7a8c34586fa53c9/components/test/data/permission_dialogs/render_tests/VrBrowserDialogTest.microphone_permission_prompt_visible_browser_ui.Pixel_XL-25.png
[modify] https://crrev.com/a9a852ff7cc2323596d82a65e7a8c34586fa53c9/components/test/data/permission_dialogs/render_tests/VrBrowserDialogTest.microphone_permission_prompt_visible_browser_ui.Pixel_XL-26.png

Project Member

Comment 5 by bugdroid1@chromium.org, Nov 15

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

commit b3cc34d8a0a55845c526837553fcc9f009763cbc
Author: bsheedy <bsheedy@chromium.org>
Date: Thu Nov 15 22:20:40 2018

Add VR UiInputManagerForTesting

Adds a test-only UiInputManager that gets swapped with the real one
anytime we're using the InputDelegateForTesting. Currently, the only
difference is that the testing version always reports that the
controller is not in the viewport.

This is so that pixel diff tests are not flaky based on the initial
orientation of the device - without this, the controller tooltips
would remain visible if the device started pointed slightly down
even though we lock the head pose forward.

Bug: 904012
Change-Id: Ia34944bd9d678c43480ef218b2d740928732f5ae
Reviewed-on: https://chromium-review.googlesource.com/c/1334941
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: Christopher Grant <cjgrant@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608545}
[modify] https://crrev.com/b3cc34d8a0a55845c526837553fcc9f009763cbc/chrome/browser/vr/BUILD.gn
[modify] https://crrev.com/b3cc34d8a0a55845c526837553fcc9f009763cbc/chrome/browser/vr/browser_renderer.cc
[modify] https://crrev.com/b3cc34d8a0a55845c526837553fcc9f009763cbc/chrome/browser/vr/browser_renderer_unittest.cc
[modify] https://crrev.com/b3cc34d8a0a55845c526837553fcc9f009763cbc/chrome/browser/vr/ui.cc
[modify] https://crrev.com/b3cc34d8a0a55845c526837553fcc9f009763cbc/chrome/browser/vr/ui.h
[modify] https://crrev.com/b3cc34d8a0a55845c526837553fcc9f009763cbc/chrome/browser/vr/ui_input_manager.cc
[modify] https://crrev.com/b3cc34d8a0a55845c526837553fcc9f009763cbc/chrome/browser/vr/ui_input_manager.h
[add] https://crrev.com/b3cc34d8a0a55845c526837553fcc9f009763cbc/chrome/browser/vr/ui_input_manager_for_testing.cc
[add] https://crrev.com/b3cc34d8a0a55845c526837553fcc9f009763cbc/chrome/browser/vr/ui_input_manager_for_testing.h
[modify] https://crrev.com/b3cc34d8a0a55845c526837553fcc9f009763cbc/chrome/browser/vr/ui_input_manager_unittest.cc
[modify] https://crrev.com/b3cc34d8a0a55845c526837553fcc9f009763cbc/chrome/browser/vr/ui_interface.h

Project Member

Comment 6 by bugdroid1@chromium.org, Nov 21

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

commit 36dbfd79336edc9d9d69efcb7d0373e0a642d414
Author: bsheedy <bsheedy@chromium.org>
Date: Wed Nov 21 21:53:27 2018

Reduce VR RenderTest flakiness

Removes three sources of flakiness in the existing VR RenderTest:
1. Switches the test page to a blank one, as the text on the original
   one sometimes resulted in several pixels being different due to AA.
2. Removes the flaky sleep while waiting for the permission prompt to
   appear in favor of a new waitForUiQuiescence.
3. Ensures that the UI is quiescent after accepting the permission
   before dumping the second image.

Also drive-by changes several methods in NativeUiUtils to try/catch
the call that throws an InterruptedException to make it less annoying
to chain multiple actions together.

Bug: 904012
Change-Id: Ic25432c947adeeba210c6c63b355a53c5c63ef14
Reviewed-on: https://chromium-review.googlesource.com/c/1344905
Reviewed-by: Bill Orr <billorr@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610228}
[modify] https://crrev.com/36dbfd79336edc9d9d69efcb7d0373e0a642d414/chrome/android/javatests/src/org/chromium/chrome/browser/vr/VrBrowserDialogTest.java
[modify] https://crrev.com/36dbfd79336edc9d9d69efcb7d0373e0a642d414/chrome/android/javatests/src/org/chromium/chrome/browser/vr/VrInstallUpdateInfoBarTest.java
[modify] https://crrev.com/36dbfd79336edc9d9d69efcb7d0373e0a642d414/chrome/android/javatests/src/org/chromium/chrome/browser/vr/util/NativeUiUtils.java
[add] https://crrev.com/36dbfd79336edc9d9d69efcb7d0373e0a642d414/chrome/test/data/xr/e2e_test_files/html/blank_2d_page.html
[modify] https://crrev.com/36dbfd79336edc9d9d69efcb7d0373e0a642d414/components/test/data/permission_dialogs/render_tests/VrBrowserDialogTest.microphone_permission_prompt_visible_browser_ui.Pixel_XL-25.png
[modify] https://crrev.com/36dbfd79336edc9d9d69efcb7d0373e0a642d414/components/test/data/permission_dialogs/render_tests/VrBrowserDialogTest.microphone_permission_prompt_visible_browser_ui.Pixel_XL-26.png

Blockedon: 908917
Render tests are in, but can't be stable until  Issue 908917  gets fixed.

Sign in to add a comment