Bug 1514892 [wpt PR 14571] - Replace XRCoodinateSystem/FrameOfReference with XRSpace/XRReferenceSpace, a=testonly
authorBrandon Jones <bajones@chromium.org>
Thu, 31 Jan 2019 15:43:29 +0000
changeset 457851 eee9c998dbb89aa29f188e3239b04a09a5a185ba
parent 457850 f1bb4858b2ac761b83f6955a208bbfce0c9e2288
child 457852 3d37c197eed98743f5bbd23045bdb2feb68ef3db
push id35518
push useropoprus@mozilla.com
push dateFri, 08 Feb 2019 09:55:14 +0000
treeherdermozilla-central@3a3e393396f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1514892, 14571, 915050, 1377711, 619745
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1514892 [wpt PR 14571] - Replace XRCoodinateSystem/FrameOfReference with XRSpace/XRReferenceSpace, a=testonly Automatic update from web-platform-tests Replace XRCoodinateSystem/FrameOfReference with XRSpace/XRReferenceSpace Updated to the newer types described by the latest WebXR Device API spec updates. Bug: 915050 Change-Id: I14f07f922ff2eee046664bd9a6ecf1cf4e954312 Reviewed-on: https://chromium-review.googlesource.com/c/1377711 Commit-Queue: Brandon Jones <bajones@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Klaus Weidner <klausw@chromium.org> Reviewed-by: Brian Sheedy <bsheedy@chromium.org> Cr-Commit-Position: refs/heads/master@{#619745} -- wpt-commits: d4c51ab0806366be26922ccda783adb4dbba4e10 wpt-pr: 14571
testing/web-platform/tests/webxr/xrSession_requestAnimationFrame_data_valid.https.html
testing/web-platform/tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https.html
testing/web-platform/tests/webxr/xrSession_requestFrameOfReference.https.html
testing/web-platform/tests/webxr/xrSession_requestReferenceSpace.https.html
--- a/testing/web-platform/tests/webxr/xrSession_requestAnimationFrame_data_valid.https.html
+++ b/testing/web-platform/tests/webxr/xrSession_requestAnimationFrame_data_valid.https.html
@@ -29,26 +29,26 @@
 
     const fakeDeviceInitOptions = { supportsImmersive:true };
     const sessionOptions = { immersive:true };
 
     let testSession;
 
     let testFunction = function(session, testDeviceController) {
       testSession = session;
-      return session.requestFrameOfReference('eye-level')
-        .then((frameOfRef) => new Promise((resolve) => {
+      return session.requestReferenceSpace({ type: 'stationary', subtype: 'eye-level' })
+        .then((referenceSpace) => new Promise((resolve) => {
 
           function onFrame(time, xrFrame) {
             assert_true(xrFrame instanceof XRFrame);
 
             assert_not_equals(xrFrame.views, null);
             assert_equals(xrFrame.views.length, 2);
 
-            let viewerPose = xrFrame.getViewerPose(frameOfRef);
+            let viewerPose = xrFrame.getViewerPose(referenceSpace);
 
             assert_not_equals(viewerPose, null);
             for(let i = 0; i < identityMatrix.length; i++) {
               assert_equals(viewerPose.poseModelMatrix[i], identityMatrix[i]);
             }
 
             assert_not_equals(viewerPose.getViewMatrix(xrFrame.views[0]), null);
             assert_equals(viewerPose.getViewMatrix(xrFrame.views[0]).length, 16);
--- a/testing/web-platform/tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https.html
+++ b/testing/web-platform/tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https.html
@@ -18,43 +18,43 @@
     let nonImmersiveSessionOptions = { outputContext: getOutputContext() };
 
     // Valid matrices for  when we don't care about specific values
     const validPoseMatrix = [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1];
     const validProjectionMatrix = [1, 0, 0, 0, 0, 1, 0, 0, 3, 2, -1, -1, 0, 0, -0.2, 0];
     const validViewMatrix = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 4, 3, 2, 1];
 
     let testFunction = function(session, fakeDeviceController, t) {
-      return session.requestFrameOfReference("eye-level")
-        .then((frameOfRef) => new Promise((resolve, reject) => {
+      return session.requestReferenceSpace({ type: 'stationary', subtype: 'eye-level' })
+        .then((referenceSpace) => new Promise((resolve, reject) => {
           let counter = 0;
           function onFrame(time, vrFrame) {
             session.requestAnimationFrame(onFrame);
             if (counter == 0) {
               t.step( () => {
                 // Expecting to not get a pose since none has been supplied
-                assert_equals(vrFrame.getViewerPose(frameOfRef), null);
+                assert_equals(vrFrame.getViewerPose(referenceSpace), null);
 
                 fakeDeviceController.setXRPresentationFrameData(
                   validPoseMatrix, [{
                     eye:"left",
                     projectionMatrix: validProjectionMatrix,
                     viewMatrix: validViewMatrix
                   }, {
                     eye:"right",
                     projectionMatrix: validProjectionMatrix,
                     viewMatrix: validViewMatrix
                   }]);
 
                 // Check that pose does not update pose within the same frame.
-                assert_equals(vrFrame.getViewerPose(frameOfRef), null);
+                assert_equals(vrFrame.getViewerPose(referenceSpace), null);
               });
             } else {
               t.step( () => {
-                let pose = vrFrame.getViewerPose(frameOfRef);
+                let pose = vrFrame.getViewerPose(referenceSpace);
                 assert_not_equals(pose, null);
 
                 let poseMatrix = pose.poseModelMatrix;
                 assert_not_equals(poseMatrix, null);
 
                 for(let i = 0; i < poseMatrix.length; i++) {
                   assert_equals(poseMatrix[i], validPoseMatrix[i]);
                 }
deleted file mode 100644
--- a/testing/web-platform/tests/webxr/xrSession_requestFrameOfReference.https.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html>
-<body>
-  <script src=/resources/testharness.js></script>
-  <script src=/resources/testharnessreport.js></script>
-  <script src="resources/webxr_util.js"></script>
-  <canvas></canvas>
-  <script>
-
-    let immersiveTestName =
-      "Immersive XRSession requestFrameOfReference returns expected objects";
-    let nonImmersiveTestName =
-      "Non-immersive XRSession requestFrameOfReference returns expected objects";
-
-    let fakeDeviceInitParams = { supportsImmersive: true };
-
-    let immersiveSessionOptions = { immersive: true };
-    let nonImmersiveSessionOptions = { outputContext: getOutputContext() };
-
-    let testFunction = function(session, fakeDeviceController, t) {
-      return promise_rejects(t, new TypeError(), session.requestFrameOfReference("foo"))
-        .then(() => Promise.all([
-          session.requestFrameOfReference("head-model").then( (frameOfRef) => {
-            assert_true(frameOfRef instanceof XRCoordinateSystem,
-              "head-model frameOfRef is not correct type.");
-            assert_true(frameOfRef instanceof XRFrameOfReference,
-              "head-model frameOfRef is not correct type.");
-          }),
-          session.requestFrameOfReference("eye-level").then( (frameOfRef) => {
-            assert_true(frameOfRef instanceof XRCoordinateSystem,
-              "eye-level frameOfRef is not correct type.");
-            assert_true(frameOfRef instanceof XRFrameOfReference,
-              "eye-level frameOfRef is not correct type.");
-          }),
-          session.requestFrameOfReference("stage").then( (frameOfRef) => {
-            assert_true(frameOfRef instanceof XRCoordinateSystem,
-              "stage frameOfRef is not correct type.");
-            assert_true(frameOfRef instanceof XRFrameOfReference,
-              "stage frameOfRef is not correct type.");
-          })
-      ]));
-    };
-
-    xr_session_promise_test(
-      immersiveTestName, testFunction, fakeDeviceInitParams, immersiveSessionOptions);
-    xr_session_promise_test(
-      nonImmersiveTestName, testFunction, fakeDeviceInitParams, nonImmersiveSessionOptions);
-
-  </script>
-</body>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/webxr/xrSession_requestReferenceSpace.https.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<body>
+  <script src=/resources/testharness.js></script>
+  <script src=/resources/testharnessreport.js></script>
+  <script src="resources/webxr_util.js"></script>
+  <canvas></canvas>
+  <script>
+
+    let immersiveTestName =
+      "Immersive XRSession requestReferenceSpace returns expected objects";
+    let nonImmersiveTestName =
+      "Non-immersive XRSession requestReferenceSpace returns expected objects";
+
+    let fakeDeviceInitParams = { supportsImmersive: true };
+
+    let immersiveSessionOptions = { immersive: true };
+    let nonImmersiveSessionOptions = { outputContext: getOutputContext() };
+
+    let testFunction = function(session, fakeDeviceController, t) {
+      return promise_rejects(t, new TypeError(), session.requestReferenceSpace({ type: "foo" }))
+        .then(() => promise_rejects(t, "NotSupportedError", session.requestReferenceSpace({ type: "stationary" })))
+        .then(() => promise_rejects(t, new TypeError(), session.requestReferenceSpace({ type: "stationary", subtype: "bar" })))
+        .then(() => Promise.all([
+          session.requestReferenceSpace({ type: "stationary", subtype: "position-disabled" }).then( (referenceSpace) => {
+            t.step(() => {
+              assert_true(referenceSpace instanceof XRSpace,
+                "position-disabled stationary reference space is not correct type.");
+              assert_true(referenceSpace instanceof XRReferenceSpace,
+                "position-disabled stationary reference space is not correct type.");
+              assert_true(referenceSpace instanceof XRStationaryReferenceSpace,
+                "position-disabled stationary reference space is not correct type.");
+            });
+          }),
+          session.requestReferenceSpace({ type: "stationary", subtype: "eye-level" }).then( (referenceSpace) => {
+            t.step(() => {
+              assert_true(referenceSpace instanceof XRSpace,
+                "eye-level stationary reference space is not correct type.");
+              assert_true(referenceSpace instanceof XRReferenceSpace,
+                "eye-level stationary reference space is not correct type.");
+              assert_true(referenceSpace instanceof XRStationaryReferenceSpace,
+                "eye-level stationary reference space is not correct type.");
+            });
+          }),
+          session.requestReferenceSpace({ type: "stationary", subtype: "floor-level" }).then( (referenceSpace) => {
+            t.step(() => {
+              assert_true(referenceSpace instanceof XRSpace,
+                "floor-level stationary reference space is not correct type.");
+              assert_true(referenceSpace instanceof XRReferenceSpace,
+                "floor-level stationary reference space is not correct type.");
+              assert_true(referenceSpace instanceof XRStationaryReferenceSpace,
+                "floor-level stationary reference space is not correct type.");
+            });
+          })
+        ]))
+        .then(() => {
+          if (!session.immersive) {
+            // Bounded reference spaces are not allowed in inline sessions.
+            return promise_rejects(t, "NotSupportedError", session.requestReferenceSpace({ type: "bounded" }))
+          }
+        })
+        .then(() => {
+          if (!session.immersive) {
+            // Unbounded reference spaces are not allowed in inline sessions.
+            return promise_rejects(t, "NotSupportedError", session.requestReferenceSpace({ type: "unbounded" }))
+          }
+        })
+    };
+
+    xr_session_promise_test(
+      immersiveTestName, testFunction, fakeDeviceInitParams, immersiveSessionOptions);
+    xr_session_promise_test(
+      nonImmersiveTestName, testFunction, fakeDeviceInitParams, nonImmersiveSessionOptions);
+
+  </script>
+</body>
\ No newline at end of file