Bug 1514111 [wpt PR 14513] - Rename XRDevicePose to XRViewerPose, a=testonly
authorJacob DeWitt <jacde@chromium.org>
Thu, 31 Jan 2019 12:12:27 +0000
changeset 457743 a65c56c261fc343e1976f61b0b9c13859e43eca8
parent 457742 e475c6db7ae37f262b64f85c8bc623ba8b8dc7e2
child 457744 aae1525c5649467362280dd8d828da62731fcd6b
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
bugs1514111, 14513, 914978, 1377142, 617565
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 1514111 [wpt PR 14513] - Rename XRDevicePose to XRViewerPose, a=testonly Automatic update from web-platform-tests Rename XRDevicePose to XRViewerPose Update blink XR code files to rename XRDevicePose to XRViewerPose and XRFrame.getDevicePose to XRFrame.getViewerPose. This is one of several changes required to make Chromium conform to the latest version of the web XR API standards, which are at: https://github.com/immersive-web/webxr/blob/master/explainer.md#appendix-b-proposed-idl This also required updating many test and expected test output files. For example, global-interface-listing-expected.txt expected test output needs to have interfaces and methods in alphabetical order. Bug: 914978 Change-Id: I60801cab151ef44d9f88a59c1caed2d65def7b51 Reviewed-on: https://chromium-review.googlesource.com/c/1377142 Commit-Queue: Jacob DeWitt <jacde@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org> Reviewed-by: David Dorwin <ddorwin@chromium.org> Reviewed-by: Bill Orr <billorr@chromium.org> Reviewed-by: Dmitry Gozman <dgozman@chromium.org> Cr-Commit-Position: refs/heads/master@{#617565} -- wpt-commits: b62fd303f841789e667cf3a789dece129c5a56d0 wpt-pr: 14513
testing/web-platform/tests/webxr/resources/webxr_util.js
testing/web-platform/tests/webxr/xrSession_requestAnimationFrame_data_valid.https.html
testing/web-platform/tests/webxr/xrSession_requestAnimationFrame_getDevicePose.https.html
testing/web-platform/tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https.html
--- a/testing/web-platform/tests/webxr/resources/webxr_util.js
+++ b/testing/web-platform/tests/webxr/resources/webxr_util.js
@@ -100,17 +100,17 @@ function forEachWebxrObject(callback) {
   callback(window.XRDevice, 'XRDevice');
   callback(window.XRSession, 'XRSession');
   callback(window.XRSessionCreationOptions, 'XRSessionCreationOptions');
   callback(window.XRFrameRequestCallback, 'XRFrameRequestCallback');
   callback(window.XRPresentationContext, 'XRPresentationContext');
   callback(window.XRFrame, 'XRFrame');
   callback(window.XRView, 'XRView');
   callback(window.XRViewport, 'XRViewport');
-  callback(window.XRDevicePose, 'XRDevicePose');
+  callback(window.XRViewerPose, 'XRViewerPose');
   callback(window.XRLayer, 'XRLayer');
   callback(window.XRWebGLLayer, 'XRWebGLLayer');
   callback(window.XRWebGLLayerInit, 'XRWebGLLayerInit');
   callback(window.XRCoordinateSystem, 'XRCoordinateSystem');
   callback(window.XRFrameOfReference, 'XRFrameOfReference');
   callback(window.XRStageBounds, 'XRStageBounds');
   callback(window.XRSessionEvent, 'XRSessionEvent');
   callback(window.XRCoordinateSystemEvent, 'XRCoordinateSystemEvent');
--- a/testing/web-platform/tests/webxr/xrSession_requestAnimationFrame_data_valid.https.html
+++ b/testing/web-platform/tests/webxr/xrSession_requestAnimationFrame_data_valid.https.html
@@ -38,27 +38,27 @@
         .then((frameOfRef) => 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 devicePose = xrFrame.getDevicePose(frameOfRef);
+            let viewerPose = xrFrame.getViewerPose(frameOfRef);
 
-            assert_not_equals(devicePose, null);
+            assert_not_equals(viewerPose, null);
             for(let i = 0; i < identityMatrix.length; i++) {
-              assert_equals(devicePose.poseModelMatrix[i], identityMatrix[i]);
+              assert_equals(viewerPose.poseModelMatrix[i], identityMatrix[i]);
             }
 
-            assert_not_equals(devicePose.getViewMatrix(xrFrame.views[0]), null);
-            assert_equals(devicePose.getViewMatrix(xrFrame.views[0]).length, 16);
-            assert_not_equals(devicePose.getViewMatrix(xrFrame.views[1]), null);
-            assert_equals(devicePose.getViewMatrix(xrFrame.views[1]).length, 16);
+            assert_not_equals(viewerPose.getViewMatrix(xrFrame.views[0]), null);
+            assert_equals(viewerPose.getViewMatrix(xrFrame.views[0]).length, 16);
+            assert_not_equals(viewerPose.getViewMatrix(xrFrame.views[1]), null);
+            assert_equals(viewerPose.getViewMatrix(xrFrame.views[1]).length, 16);
 
             // Test does not complete until the returned promise resolves.
             resolve();
           }
 
           testDeviceController.setXRPresentationFrameData(
             identityMatrix,
             [rightFakeXRViewInit, leftFakeXRViewInit]
deleted file mode 100644
--- a/testing/web-platform/tests/webxr/xrSession_requestAnimationFrame_getDevicePose.https.html
+++ /dev/null
@@ -1,79 +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 =
-      "XRFrame getDevicePose updates on the next frame for immersive sessions";
-    let nonImmersiveTestName =
-      "XRFrame getDevicePose updates on the next frame for non-immersive sessions";
-
-    let fakeDeviceInitParams = { supportsImmersive: true };
-
-    let immersiveSessionOptions = { immersive: true };
-    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) => {
-          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.getDevicePose(frameOfRef), 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.getDevicePose(frameOfRef), null);
-              });
-            } else {
-              t.step( () => {
-                let pose = vrFrame.getDevicePose(frameOfRef);
-                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]);
-                }
-              });
-
-              // Finished.
-              resolve();
-            }
-            counter++;
-          }
-
-          session.requestAnimationFrame(onFrame);
-        }));
-    };
-
-    xr_session_promise_test(nonImmersiveTestName, testFunction,
-      fakeDeviceInitParams, nonImmersiveSessionOptions);
-    xr_session_promise_test(immersiveTestName, testFunction,
-      fakeDeviceInitParams, immersiveSessionOptions);
-
-  </script>
-</body>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https.html
@@ -0,0 +1,79 @@
+<!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 =
+      "XRFrame getViewerPose updates on the next frame for immersive sessions";
+    let nonImmersiveTestName =
+      "XRFrame getViewerPose updates on the next frame for non-immersive sessions";
+
+    let fakeDeviceInitParams = { supportsImmersive: true };
+
+    let immersiveSessionOptions = { immersive: true };
+    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) => {
+          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);
+
+                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);
+              });
+            } else {
+              t.step( () => {
+                let pose = vrFrame.getViewerPose(frameOfRef);
+                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]);
+                }
+              });
+
+              // Finished.
+              resolve();
+            }
+            counter++;
+          }
+
+          session.requestAnimationFrame(onFrame);
+        }));
+    };
+
+    xr_session_promise_test(nonImmersiveTestName, testFunction,
+      fakeDeviceInitParams, nonImmersiveSessionOptions);
+    xr_session_promise_test(immersiveTestName, testFunction,
+      fakeDeviceInitParams, immersiveSessionOptions);
+
+  </script>
+</body>