Skip to content
Permalink
Browse files

Add tests for viewer space

  • Loading branch information...
Manishearth committed Jun 12, 2019
1 parent f09d160 commit 5b8f0ed2e30254329a7c644bc4cd6df8b64e1eb5
Showing with 8 additions and 2 deletions.
  1. +1 −1 tests/wpt/mozilla/meta/MANIFEST.json
  2. +7 −1 tests/wpt/mozilla/tests/webxr/obtain_frame.html
@@ -19687,7 +19687,7 @@
"testharness"
],
"webxr/obtain_frame.html": [
"5182093b33f0870550157d648e41376a91fd95ce",
"99d8fd1ef152e4030444c3ca42482d28c3e855d3",
"testharness"
],
"webxr/resources/webxr-util.js": [
@@ -21,7 +21,7 @@
let frame = await new Promise(resolve => {
session.requestAnimationFrame((time, frame) => resolve(frame));
});
let space = await session.requestReferenceSpace("local");
let pose = frame.getViewerPose(space);
assert_matrix_approx_equals(pose.transform.matrix, [1,0,0,0,0,0,1,0,0,-1,0,0,0.5,0.1,0.1,1], 0.001, "head pose matrix");
@@ -59,6 +59,12 @@
throw "got unknown view";
}
}
let viewer = await session.requestReferenceSpace("viewer");
pose = frame.getViewerPose(viewer);
assert_matrix_approx_equals(pose.transform.matrix, [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1], 0.001, "viewerPose of viewer is identity");
assert_matrix_approx_equals(frame.getViewerPose(space).transform.matrix, frame.getPose(viewer, space).transform.matrix, 0.001, "viewerPose(space) == pose(viewer, space)");
assert_matrix_approx_equals(frame.getViewerPose(offset).transform.matrix, frame.getPose(viewer, offset).transform.matrix, 0.001, "viewerPose(offset) == pose(viewer, offset)");
});
</script>
</body>

0 comments on commit 5b8f0ed

Please sign in to comment.
You can’t perform that action at this time.