xrRigidTransform_sameObject.https.html (1393B)
1 <!DOCTYPE html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="resources/webxr_util.js"></script> 5 <script src="resources/webxr_test_constants.js"></script> 6 <script> 7 8 let testName = "XRRigidTransform position and orientation meet [SameObject] requirements"; 9 10 // xrRigidTransform_inverse.https.html already checks [SameObject] requirement 11 // for XRRigidTransform.inverse. It's in a separate test because there are 12 // additional constraints around how the inverse attribute should work besides 13 // just [SameObject]. 14 15 let testFunction = 16 (session, fakeDeviceController, t) => new Promise((resolve, reject) => { 17 18 let transform = new XRRigidTransform( 19 { x: -9.0, y: 8.0, z: -7.0 }, 20 { x: 6.0, y: -5.0, z: 4.0, w: 3.0 }); 21 22 let position = transform.position; 23 let orientation = transform.orientation; 24 let matrix = transform.matrix; 25 t.step(() => { 26 assert_equals(position, transform.position, 27 "XRRigidTransform.position returns the same object."); 28 assert_equals(orientation, transform.orientation, 29 "XRRigidTransform.orientation returns the same object."); 30 assert_equals(matrix, transform.matrix, 31 "XRRigidTransform.matrix returns the same object."); 32 }); 33 34 resolve(); 35 }); 36 37 xr_session_promise_test(testName, testFunction, TRACKED_IMMERSIVE_DEVICE, 38 'immersive-vr'); 39 40 </script>