Name: Immersive Web - WebXR Samples
Short Name: webxr-samples
URL: https://github.com/immersive-web/webxr-samples/
Version: 0
Revision: ddcb40e3b86f01d481461b4c856808988fab9610
Date: 2019-01-15
License: MIT
License File: LICENSE
Security Critical: no
Shipped: no
Description:
A fork of the WebXR samples to be kept in sync with Chrome and used for testing Chrome.
Local Modifications:
- Forked to provide a stable set of test pages in sync with Chrome.
- Stripped out the media/ directory to minimize the size.
- Adapted samples to work without node compilation
- Added source from https://github.com/toji/gl-matrix (MIT licensed)
to js/third-party/gl-matrix, including license file and README.chromium.
- Added missing license file and README.chromium for dat.gui
- Removed the version shim, the samples are intended to work specifically
with the ToT Chrome version.
Instructions:
In order to serve the samples locally, a few steps are required:
1. Most samples use images and glTF objects that are stored separately. To make
these available, copy the contents of
src/chrome/test/data/xr/webxr_samples/media/
into a new directory:
src/third_party/webxr_test_pages/webxr-samples/media/
You can skip this step if you are testing the 'barebones' samples.
2. Serve files using a local web server, for example by running
`python -m SimpleHTTPServer <port number>` in
src/third_party/webxr_test_pages/webxr-samples/
3. If you are having trouble with the python server such as it being unreliable
serving media like the gltf files, try using "npm serve".
To install: `sudo npm install -g serve`
To run: `serve .` in src/third_party/webxr_test_pages/webxr-samples/
4. For testing on an Android phone, open chrome://inspect/?tracing#devices
and ensure that your phone is visible. The phone must have USB debugging enabled.
Then enable port forwarding for your local web server's port. This makes
the local web server available on the phone at the address
http://localhost/<port number>, for example http://localhost/8080/
See https://developer.chrome.com/docs/devtools/remote-debugging/
for more detailed instructions.
The following instructions explain how to update the public copy of the repository
which is stored in a Google cloud bucket. To verify if you have sufficient
access to the cloud bucket:
1. Run:
gsutil.py ls -d gs://chromium-webxr-test
3. If you get authentication errors such as this one:
Your credentials are invalid. For more help, see "gsutil help creds", or re-run the gsutil config command (see "gsutil help config").
Try running:
gsutil.py config
and authenticate using your google.com identity. Use project ID 0.
WARNING: make sure to use gsutil.py (note .py suffix) from depot_tools. Your
computer may have a separate copy of gsutil from the google-cloud-sdk
package which is NOT equivalent.
To publish a temporary copy in a cloud bucket:
This step isn't needed for routine changes, but can be useful in case you want
to test a change as served from the cloud bucket before submitting the change.
1. Copy the current workspace content to a temporary bucket. Use a unique
name, not starting with rREVISION to avoid confusion with the normal snapshots
python3 ./update_bucket.py -v --direct-publish-samples-source=webxr-samples --direct-publish-samples-dest=tmp-klausw-cr3924689
2. Access your change at the corresponding bucket location:
https://storage.googleapis.com/chromium-webxr-test/tmp-klausw-cr3924689/index.html
3. When done, go to the cloud console at
https://pantheon.corp.google.com/storage/browser/chromium-webxr-test
and delete the temporary bucket.
To publish samples for the current tip of tree (after your change was submitted):
1. Ensure that you have a clean checkout of third_party/webxr_test_pages/ with
no local changes.
2. From the webxr_test_pages directory, run:
python3 update-bucket.py
You can add the --dry-run flag to check the proposed action before making changes,
and/or --verbose for additional detail.
To publish samples for OT:
1. python make_ot_samples_folder.py webxr-samples <dest-folder>
That copies just the subset of samples that we want to publish.
2. Serve <dest-folder> locally and make sure everything works.
3. python update_bucket.py --direct-publish-samples-source=<dest-folder> --direct-publish-samples-dest=<bucket-dest-subfolder>
To create a Google Cloud WebXR-Samples bucket:
1. Navigate to the Google Cloud console at https://console.cloud.google.com/
2. Navigate to storage, and click "Create Bucket"
3. Name the bucket, and set it's configuration to use a Multi-region location type, and uniform
access control.
4. (Optional) Grant the bucket public access:
a. Select your bucket from the storage browser
b. Click "Permissions"
c. Click "Add"
d. Add the member "allUsers" with the role "Storage Object Viewer"
e. Add the member "allAuthenticatedUsers" with the role "Storage Object Viewer"
f. Accept the prompt notifying you that you will make the bucket public to the internet.
5. Select a project as bucket owner. (If this is not the default 'chromium-webxr-test'
use `update_bucket.py --bucket gs://PROJECT_ID` in the steps below to override its default.)
6. Create a "media" folder at the top level directory of your bucket, this folder should contain a
copy of https://github.com/immersive-web/webxr-samples/tree/master/media
7. Verify the changes are working as intended by navigating to your bucket's index's public access
URL.