Commit 42d47e24 authored by Alexander Cooper's avatar Alexander Cooper Committed by Commit Bot

Update XR Test Documentation

Fixed: 1099834
Change-Id: Ib434e634528e1ac56efecb3e8c97201558eafd3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2278307
Auto-Submit: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: default avatarBrian Sheedy <bsheedy@chromium.org>
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Cr-Commit-Position: refs/heads/master@{#785840}
parent baffcf60
......@@ -24,13 +24,8 @@ playback datasets that are necessary.
## Introduction
This directory contains all the Java-side infrastructure for running
instrumentation tests for XR (VR/Virtual Reality and AR/Augmented Reality)
features currently in Chrome:
* [WebVR](https://webvr.info/) - Experience VR content on the web
* [WebXR](https://immersive-web.github.io/webxr-samples/explainer.html) -
Successor to WebVR, experience VR and AR content on the web
* VR Browser - Browse the 2D web from a VR headset
instrumentation tests for [WebXR][webxr_spec]
(VR/Virtual Reality and AR/Augmented Reality) features currently in Chrome.
These tests are integration/end-to-end tests run in the full Chromium browser on
actual Android devices.
......@@ -43,9 +38,6 @@ testing.
### Subdirectories
* `mock/` - Contains all the classes for mock implementations of XR classes.
* `nfc_apk/` - Contains the code for the standalone APK for NFC simulation. Used
by Telemetry tests, not instrumentation tests, but kept here since it uses code
from `util/`.
* `rules/` - Contains all the XR-specific JUnit4 rules for handling
functionality such as running tests multiple times in different activities and
handling the fake VR pose tracker service.
......@@ -190,7 +182,7 @@ want to manually apply settings outside of a test, you can do so with
See [adding_new_tests.md][adding_new_tests].
[webxr_spec]: https://immersive-web.github.io/webxr-samples/explainer.html
[shared_prefs_dir]:
https://chromium.googlesource.com/chromium/src/+/master/chrome/android/shared_preference_files/test
[html_dir]: https://chromium.googlesource.com/chromium/src/+/master/chrome/test/data/xr/e2e_test_files
......@@ -198,4 +190,4 @@ https://chromium.googlesource.com/chromium/src/+/master/chrome/android/shared_pr
[vr_test_libraries]: https://chromium.googlesource.com/chromium/src/+/master/third_party/gvr-android-sdk/test-libraries
[ar_test_apks]: https://chromium.googlesource.com/chromium/src/+/master/third_party/arcore-android-sdk/test-apks
[adding_new_tests]:
https://chromium.googlesource.com/chromium/src/+/master/chrome/android/javatests/src/org/chromium/chrome/browser/vr/adding_new_tests.md
\ No newline at end of file
https://chromium.googlesource.com/chromium/src/+/master/chrome/android/javatests/src/org/chromium/chrome/browser/vr/adding_new_tests.md
......@@ -90,9 +90,9 @@ placed in `//chrome/test/data/xr/e2e_test_files/html`. The exact contents of
your file will depend on your test, but you will likely be importing some or all
of the following scripts from `//chrome/test/data/xr/e2e_test_files/resources`:
* `webxr_e2e.js`/`webvr_e2e.js` - Sets up the necessary code to communicate back
* `webxr_e2e.js` - Sets up the necessary code to communicate back
and forth between Java and JavaScript
* `webxr_boilerplate.js`/`webvr_boilerplate.js` - Handles the WebXR and WebVR
* `webxr_boilerplate.js` - Handles the WebXR and WebVR
boilerplate code, such as getting an XRDevice and setting up a canvas.
Additionally, in order to use asserts in JavaScript, you must import
......@@ -119,24 +119,7 @@ need to add before being able to write your test.
### Test Parameterization
Test parameterization is how running a test multiple times in different
activities is handled. However, it adds some amount of overhead to test runtime,
so it's only enabled where it makes sense. If your new test class will only have
VR Browser-related tests, you can skip parameterization. Otherwise, you'll want
to enable it.
#### Non-Parameterized
See [`VrBrowserTransitionTest`][vr_browser_transition_test] for an example of a
non-parameterized class. The general things you will need to do are:
* Set the class' `@RunWith` to `ChromeJUnit4ClassRunner.class`.
* Declare `mTestRule` as a `ChromeTabbedActivityVrTestRule`, annotate it with
`@Rule`, and initialize it where it's declared.
* Declare `mVrBrowserTestFramework` as a `VrBrowserTestFramework` and initialize
it using `mTestRule` in a setup method annotated with `@Before`. You can do
the same with other types of test frameworks as necessary.
#### Parameterized
activities is handled. However, it adds some amount of overhead to test runtime.
See [`WebXrVrTransitionTest`][webxr_vr_transition_test] for an example of a
parameterized class. The general things you will need to are:
......
......@@ -19,8 +19,6 @@ self-explanatory) naming convention:
feature.
* `AR`/`Ar` - A subset of `XR`. Used for things that are applicable to any AR
feature.
* `VR Browser`/`VrBrowser` - A subset of `VR`. Used for things that are only
applicable to the VR Browser feature of Chrome.
* `WebXR`/`WebXr` - A subset of `XR`. Used for things that are applicable to any
XR-related web APIs.
* `WebXR for AR`/`WebXrAr` - A subset of `WebXR` and `AR`. Used for things that
......@@ -36,7 +34,6 @@ Based on the above naming scheme, the various `TestFramework` classes are
structured in the following hierarchy:
* `XrTestFramework`
* `VrBrowserTestFramework`
* `WebXrTestFramework`
* `WebXrArTestFramework`
* `WebXrVrTestFramework`
......
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