Changeset 265546 in webkit
- Timestamp:
- Aug 12, 2020 4:06:45 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 17 added
- 50 edited
- 2 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r265543 r265546 1 2020-08-06 Sergio Villar Senin <svillar@igalia.com> 2 3 [WebXR] Update WebXR WPT directory 4 https://bugs.webkit.org/show_bug.cgi?id=215224 5 6 Reviewed by Youenn Fablet. 7 8 * platform/wpe/TestExpectations: Skipped one test that started to fail after the import. 9 1 10 2020-08-12 Chris Lord <clord@igalia.com> 2 11 -
trunk/LayoutTests/imported/w3c/ChangeLog
r265543 r265546 1 2020-08-06 Sergio Villar Senin <svillar@igalia.com> 2 3 [WebXR] Update WebXR WPT directory 4 https://bugs.webkit.org/show_bug.cgi?id=215224 5 6 Reviewed by Youenn Fablet. 7 8 * web-platform-tests/webxr/anchors/ar_anchor_freefloating_create_move.https.html: Added. 9 * web-platform-tests/webxr/anchors/ar_anchor_freefloating_delay_creation.https.html: Added. 10 * web-platform-tests/webxr/anchors/ar_anchor_freefloating_failure.https.html: Added. 11 * web-platform-tests/webxr/anchors/ar_anchor_freefloating_pause_resume_stop.https.html: Added. 12 * web-platform-tests/webxr/anchors/ar_anchor_states.https.html: Added. 13 * web-platform-tests/webxr/anchors/idlharness.https.window.html: Added. 14 * web-platform-tests/webxr/anchors/idlharness.https.window.js: Copied from LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/idlharness.https.window.js. 15 (async idl_array): 16 * web-platform-tests/webxr/anchors/w3c-import.log: Added. 17 * web-platform-tests/webxr/ar-module/idlharness.https.window-expected.txt: 18 * web-platform-tests/webxr/ar-module/idlharness.https.window.js: 19 (async idl_array): 20 * web-platform-tests/webxr/dom-overlay/ar_dom_overlay.https.html: 21 * web-platform-tests/webxr/dom-overlay/ar_dom_overlay_hit_test.https.html: Added. 22 * web-platform-tests/webxr/dom-overlay/idlharness.https.window.html: Added. 23 * web-platform-tests/webxr/dom-overlay/idlharness.https.window.js: Copied from LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/idlharness.https.window.js. 24 (async idl_array): 25 * web-platform-tests/webxr/dom-overlay/w3c-import.log: 26 * web-platform-tests/webxr/events_input_sources_change.https.html: 27 * web-platform-tests/webxr/events_referenceSpace_reset_immersive.https.html: 28 * web-platform-tests/webxr/events_session_select.https.html: 29 * web-platform-tests/webxr/events_session_select_subframe.https.html: 30 * web-platform-tests/webxr/events_session_squeeze.https.html: 31 * web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_disconnect.https.html: 32 * web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_input_registered.https.html: 33 * web-platform-tests/webxr/getInputPose_handedness.https.html: 34 * web-platform-tests/webxr/getInputPose_pointer.https.html: 35 * web-platform-tests/webxr/getViewerPose_emulatedPosition.https.html: 36 * web-platform-tests/webxr/hit-test/ar_hittest_subscription_inputSources.https.html: Added. 37 * web-platform-tests/webxr/hit-test/ar_hittest_subscription_refSpaces.https.html: 38 * web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_regular.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states.https.html. 39 * web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_transient.https.html: Added. 40 * web-platform-tests/webxr/hit-test/ar_hittest_subscription_transientInputSources.https.html: Added. 41 * web-platform-tests/webxr/hit-test/idlharness.https.html: Added. 42 * web-platform-tests/webxr/hit-test/w3c-import.log: 43 * web-platform-tests/webxr/hit-test/xrRay_constructor.https.html: 44 * web-platform-tests/webxr/idlharness.https.window-expected.txt: 45 * web-platform-tests/webxr/idlharness.https.window.js: 46 (async idl_array): 47 * web-platform-tests/webxr/render_state_update.https.html: Added. 48 * web-platform-tests/webxr/resources/webxr_test_constants.js: 49 * web-platform-tests/webxr/resources/webxr_util.js: 50 (xr_debug): 51 (async requestSkipAnimationFrame): 52 (async loadChromiumResources): 53 (setupWebKitWebXRTestAPI): 54 (xr_promise_test): Deleted. 55 (async xr_session_promise_test): Deleted. 56 * web-platform-tests/webxr/w3c-import.log: 57 * web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https.html: 58 * web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https.html: 59 * web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html: Added. 60 * web-platform-tests/webxr/xrBoundedReferenceSpace_updates.https.html: 61 * web-platform-tests/webxr/xrInputSource_add_remove.https.html: 62 * web-platform-tests/webxr/xrInputSource_emulatedPosition.https.html: 63 * web-platform-tests/webxr/xrInputSource_profiles.https.html: 64 * web-platform-tests/webxr/xrInputSource_sameObject.https.html: 65 * web-platform-tests/webxr/xrPose_transform_sameObject.https.html: 66 * web-platform-tests/webxr/xrReferenceSpace_originOffset.https.html: 67 * web-platform-tests/webxr/xrReferenceSpace_originOffsetBounded.https.html: 68 * web-platform-tests/webxr/xrReferenceSpace_relationships.https.html: Added. 69 * web-platform-tests/webxr/xrSession_input_events_end.https.html: 70 * web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https.html: 71 * web-platform-tests/webxr/xrSession_sameObject.https.html: 72 * web-platform-tests/webxr/xrSession_visibilityState.https.html: 73 * web-platform-tests/webxr/xrStationaryReferenceSpace_floorlevel_updates.https.html: 74 * web-platform-tests/webxr/xrWebGLLayer_constructor.https.html: 75 1 76 2020-08-12 Chris Lord <clord@igalia.com> 2 77 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/idlharness.https.window.js
r265545 r265546 4 4 'use strict'; 5 5 6 // https://immersive-web.github.io/ webxr-ar-module/6 // https://immersive-web.github.io/anchors/ 7 7 8 8 idl_test( 9 [' webxr-ar-module'],10 [' webxr', 'dom'],9 ['anchors'], 10 ['hit-test', 'webxr', 'dom'], 11 11 async idl_array => { 12 12 idl_array.add_objects({ 13 // TODO: XRSession13 // TODO: Add object instances 14 14 }); 15 15 } -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/idlharness.https.window-expected.txt
r265239 r265546 10 10 PASS XRSession interface: attribute environmentBlendMode 11 11 PASS XRSession interface: attribute interactionMode 12 PASS XRSession interface: xrSession must inherit property "environmentBlendMode" with the proper type 13 PASS XRSession interface: xrSession must inherit property "interactionMode" with the proper type 12 14 FAIL XRView interface: attribute isFirstPersonObserver assert_true: The prototype object must have a property "isFirstPersonObserver" expected true got false 13 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/idlharness.https.window.js
r258499 r265546 11 11 async idl_array => { 12 12 idl_array.add_objects({ 13 // TODO: XRSession13 XRSession: ['xrSession'], 14 14 }); 15 self.xrSession = await navigator.xr.requestSession('inline'); 15 16 } 16 17 ); -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/ar_dom_overlay.https.html
r258499 r265546 107 107 108 108 let testInput = function(overlayElement, session, fakeDeviceController, t) { 109 let debug = xr_debug.bind(this, 'testInput'); 109 110 110 111 // Use two DIVs for this test. "inner_a" uses a "beforexrselect" handler … … 136 137 session.requestReferenceSpace('viewer').then(function(viewerSpace) { 137 138 // Press the primary input button and then release it a short time later. 138 session.requestAnimationFrame((time, xrFrame) => { 139 debug('got viewerSpace'); 140 requestSkipAnimationFrame(session, (time, xrFrame) => { 141 debug('got rAF 1'); 139 142 input_source.setOverlayPointerPosition(inner_a.offsetLeft + 1, 140 143 inner_a.offsetTop + 1); … … 142 145 143 146 session.requestAnimationFrame((time, xrFrame) => { 147 debug('got rAF 2'); 144 148 input_source.endSelection(); 145 149 146 150 session.requestAnimationFrame((time, xrFrame) => { 151 debug('got rAF 3'); 147 152 // Need to process one more frame to allow select to propagate. 148 153 session.requestAnimationFrame((time, xrFrame) => { 154 debug('got rAF 4'); 149 155 session.dispatchEvent(watcherStep); 150 156 … … 152 158 153 159 session.requestAnimationFrame((time, xrFrame) => { 160 debug('got rAF 5'); 154 161 input_source.setOverlayPointerPosition(inner_b.offsetLeft + 1, 155 162 inner_b.offsetTop + 1); … … 157 164 158 165 session.requestAnimationFrame((time, xrFrame) => { 166 debug('got rAF 6'); 159 167 input_source.endSelection(); 160 168 161 169 session.requestAnimationFrame((time, xrFrame) => { 170 debug('got rAF 7'); 162 171 // Need to process one more frame to allow select to propagate. 163 172 session.dispatchEvent(watcherDone); … … 174 183 175 184 let testCrossOriginContent = function(overlayElement, session, fakeDeviceController, t) { 185 let debug = xr_debug.bind(this, 'testCrossOriginContent'); 186 176 187 let iframe = document.getElementById('iframe'); 177 188 assert_true(iframe != null); … … 192 203 session.requestReferenceSpace('viewer').then(function(viewerSpace) { 193 204 // Press the primary input button and then release it a short time later. 194 session.requestAnimationFrame((time, xrFrame) => { 205 requestSkipAnimationFrame(session, (time, xrFrame) => { 206 debug('got rAF 1'); 195 207 input_source.setOverlayPointerPosition(iframe.offsetLeft + 1, 196 208 iframe.offsetTop + 1); … … 198 210 199 211 session.requestAnimationFrame((time, xrFrame) => { 212 debug('got rAF 2'); 200 213 input_source.endSelection(); 201 214 202 215 session.requestAnimationFrame((time, xrFrame) => { 216 debug('got rAF 3'); 203 217 // Need to process one more frame to allow select to propagate. 204 218 session.requestAnimationFrame((time, xrFrame) => { 219 debug('got rAF 4'); 205 220 session.dispatchEvent(watcherStep); 206 221 207 222 session.requestAnimationFrame((time, xrFrame) => { 223 debug('got rAF 5'); 208 224 input_source.setOverlayPointerPosition(inner_b.offsetLeft + 1, 209 225 inner_b.offsetTop + 1); … … 211 227 212 228 session.requestAnimationFrame((time, xrFrame) => { 229 debug('got rAF 6'); 213 230 input_source.endSelection(); 214 231 215 232 session.requestAnimationFrame((time, xrFrame) => { 233 debug('got rAF 7'); 216 234 // Need to process one more frame to allow select to propagate. 217 235 session.dispatchEvent(watcherDone); -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/idlharness.https.window.js
r265545 r265546 4 4 'use strict'; 5 5 6 // https://immersive-web.github.io/ webxr-ar-module/6 // https://immersive-web.github.io/dom-overlays/ 7 7 8 8 idl_test( 9 [' webxr-ar-module'],10 ['webxr', ' dom'],9 ['dom-overlays'], 10 ['webxr', 'html', 'dom'], 11 11 async idl_array => { 12 12 idl_array.add_objects({ 13 // TODO: XRSession13 // TODO: Add object instances 14 14 }); 15 15 } -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/w3c-import.log
r258499 r265546 16 16 List of files: 17 17 /LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/ar_dom_overlay.https.html 18 /LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/ar_dom_overlay_hit_test.https.html 19 /LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/idlharness.https.window.js -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_sources_change.https.html
r258499 r265546 102 102 // Make our input source disappear after one frame, and wait an additional 103 103 // frame for that disappearance to propogate. 104 session.requestAnimationFrame((time, xrFrame) => {104 requestSkipAnimationFrame(session, (time, xrFrame) => { 105 105 input_source.disconnect(); 106 106 session.requestAnimationFrame((time, xrFrame) => {}); -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/events_referenceSpace_reset_immersive.https.html
r258499 r265546 41 41 42 42 // The triggered resetPose event should arrive after the next Animation Frame 43 session.requestAnimationFrame(() => {});43 requestSkipAnimationFrame(session, () => {}); 44 44 45 45 return resetPromise; -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select.https.html
r258499 r265546 93 93 94 94 // Press the primary input button and then release it a short time later. 95 session.requestAnimationFrame((time, xrFrame) => {95 requestSkipAnimationFrame(session, (time, xrFrame) => { 96 96 input_source.startSelection(); 97 97 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select_subframe.https.html
r258499 r265546 52 52 53 53 // Press the primary input button and then release it a short time later. 54 session.requestAnimationFrame((time, xrFrame) => {54 requestSkipAnimationFrame(session, (time, xrFrame) => { 55 55 input_source.simulateSelect(); 56 56 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_squeeze.https.html
r258499 r265546 115 115 116 116 //Simulate a grip starting then release it a short time later. 117 session.requestAnimationFrame((time, xrFrame) => {117 requestSkipAnimationFrame(session, (time, xrFrame) => { 118 118 input_source.updateButtonState(pressed_grip_button); 119 119 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_disconnect.https.html
r258499 r265546 133 133 // session, at which point the controller should be disconnected. 134 134 return new Promise((resolve) => { 135 session.requestAnimationFrame(() => {135 requestSkipAnimationFrame(session, () => { 136 136 input_source.setSupportedButtons([]); 137 137 session.requestAnimationFrame(() => { -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_input_registered.https.html
r258499 r265546 70 70 // fire an inputsourceschange event). 71 71 return new Promise((resolve) => { 72 session.requestAnimationFrame(() => {72 requestSkipAnimationFrame(session, () => { 73 73 // Make sure the exposed gamepad has the number of buttons and axes we 74 74 // requested. -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/getInputPose_handedness.https.html
r258499 r265546 76 76 77 77 // Handedness only updates during an XR frame. 78 session.requestAnimationFrame(CheckNone);78 requestSkipAnimationFrame(session, CheckNone); 79 79 }); 80 80 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/getInputPose_pointer.https.html
r258499 r265546 52 52 53 53 t.step( () => { 54 // When a grip matrix is present but no pointer offset is specified, 55 // the grip and pointer matrices should be the same. 54 // When a grip matrix is set, both the grip and pointer matrices 55 // should yield their set values (i.e. the pointerOrigin is *not* 56 // transformed by the gripOrigin). 56 57 assert_not_equals(grip_pose, null); 57 58 assert_matrix_approx_equals(grip_pose.transform.matrix, VALID_GRIP, 58 59 FLOAT_EPSILON, "Grip matrix is not equal to input."); 59 60 assert_matrix_approx_equals(input_pose.transform.matrix, 60 grip_pose.transform.matrix, FLOAT_EPSILON,61 " Grip matrix is not equal to target ray matrix.");61 IDENTITY_MATRIX, FLOAT_EPSILON, 62 "Pointer matrix is not equal to its set value."); 62 63 }); 63 64 … … 74 75 75 76 t.step( () => { 76 // When a grip matrix and pointer offset are specified, 77 // pointer matrix should be grip matrix multiplied with the pointer 78 // offset. 77 // Verify that changes to the pointer origin are properly reflected. 79 78 assert_not_equals(grip_pose, null); 80 79 assert_matrix_approx_equals(grip_pose.transform.matrix, VALID_GRIP, 81 80 FLOAT_EPSILON, "Grip matrix is not equal to input valid grip."); 82 81 assert_matrix_approx_equals(input_pose.transform.matrix, 83 VALID_ GRIP_WITH_POINTER_OFFSET, FLOAT_EPSILON,84 " Grip matrix not multipledproperly.");82 VALID_POINTER, FLOAT_EPSILON, 83 "Pointer matrix not set properly."); 85 84 }); 86 85 … … 89 88 90 89 // Can only request input poses in an xr frame. 91 session.requestAnimationFrame(CheckInvalidGrip);90 requestSkipAnimationFrame(session, CheckInvalidGrip); 92 91 }); 93 92 }); -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/getViewerPose_emulatedPosition.https.html
r258499 r265546 17 17 18 18 let testFunction = function(session, fakeDeviceController, t) { 19 let debug = xr_debug.bind(this, 'testFunction'); 19 20 return session.requestReferenceSpace('local') 20 21 .then((referenceSpace) => new Promise((resolve, reject) => { 22 debug('refSpace promise'); 21 23 function CheckPositionNotEmulated(time, vrFrame){ 24 debug('rAF 1: checkPositionNotEmulated'); 22 25 t.step(() => { 23 26 let pose = vrFrame.getViewerPose(referenceSpace); … … 31 34 32 35 function CheckPositionEmulated(time, vrFrame) { 36 debug('rAF 2: checkPositionEmulated'); 33 37 t.step(() => { 34 38 let pose = vrFrame.getViewerPose(referenceSpace); … … 38 42 39 43 // Finished. 44 debug('resolve'); 40 45 resolve(); 41 46 } 42 47 43 session.requestAnimationFrame(CheckPositionNotEmulated);48 requestSkipAnimationFrame(session, CheckPositionNotEmulated); 44 49 })); 45 50 }; -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_refSpaces.https.html
r258499 r265546 18 18 // 0.25m above world origin. 19 19 const FLOOR_ORIGIN_TRANSFORM = { 20 position: [0, -0.25, 0],20 position: [0, 0.25, 0], 21 21 orientation: [0, 0, 0, 1], 22 22 }; … … 25 25 supportedModes: ["immersive-ar"], 26 26 views: VALID_VIEWS, 27 floorOrigin: FLOOR_ORIGIN_TRANSFORM, // aka floor_from_mojo27 floorOrigin: FLOOR_ORIGIN_TRANSFORM, // aka mojo_from_floor 28 28 viewerOrigin: VIEWER_ORIGIN_TRANSFORM, // aka mojo_from_viewer 29 29 supportedFeatures: ALL_FEATURES, … … 65 65 for(const [index, expectedPose] of expectedPoses.entries()) { 66 66 const pose = hitTestResults[index].getPose(localRefSpace); 67 assert_true(pose != null, "Each hit test result should have a pose in viewerspace");67 assert_true(pose != null, "Each hit test result should have a pose in local space"); 68 68 if(expectedPose != null) { 69 69 assert_transform_approx_equals(pose.transform, expectedPose); -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_regular.https.html
r265545 r265546 16 16 }; 17 17 18 // Creates a test method that leverages regular hit test API (as opposed to hit 19 // test for transient input). 18 20 // |shouldSucceed| - true if the hit test request is expected to succeed, false otherwise 19 21 // |endSession| - true if the test case should call session.end() prior to requesting hit test 20 const testFunctionGenerator = function(shouldSucceed, endSession) { 22 // |expectedError| - expected error name that should be returned in case shouldSucceed is false 23 const testFunctionGeneratorRegular = function(shouldSucceed, endSession, expectedError) { 21 24 const testFunction = function(session, fakeDeviceController, t) { 22 25 session.requestReferenceSpace('viewer').then((viewerRefSpace) => { … … 40 43 assert_false(shouldSucceed, 41 44 "`requestHitTestSource` failed when it was expected to succeed, error: " + error); 45 assert_equals(error.name, expectedError, 46 "`requestHitTestSource` failed with unexpected error name"); 42 47 }); 43 48 }); … … 49 54 50 55 xr_session_promise_test("Hit test subscription succeeds if the feature was requested", 51 testFunctionGenerator (/*shouldSucceed=*/true, /*endSession=*/false),56 testFunctionGeneratorRegular(/*shouldSucceed=*/true, /*endSession=*/false), 52 57 fakeDeviceInitParams, 53 58 'immersive-ar', { 'requiredFeatures': ['hit-test'] }); 54 59 55 60 xr_session_promise_test("Hit test subscription fails if the feature was not requested", 56 testFunctionGenerator (/*shouldSucceed=*/false, /*endSession=*/false),61 testFunctionGeneratorRegular(/*shouldSucceed=*/false, /*endSession=*/false, "NotSupportedError"), 57 62 fakeDeviceInitParams, 58 63 'immersive-ar', {}); 59 64 60 65 xr_session_promise_test("Hit test subscription fails if the feature was requested but the session already ended", 61 testFunctionGenerator (/*shouldSucceed=*/false, /*endSession=*/true),66 testFunctionGeneratorRegular(/*shouldSucceed=*/false, /*endSession=*/true, "InvalidStateError"), 62 67 fakeDeviceInitParams, 63 68 'immersive-ar', { 'requiredFeatures': ['hit-test'] }); -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/w3c-import.log
r258499 r265546 15 15 ------------------------------------------------------------------------ 16 16 List of files: 17 /LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_inputSources.https.html 17 18 /LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_refSpaces.https.html 18 /LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states.https.html 19 /LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_regular.https.html 20 /LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_transient.https.html 21 /LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_transientInputSources.https.html 22 /LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/idlharness.https.html 19 23 /LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/xrRay_constructor.https.html 20 24 /LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/xrRay_matrix.https.html -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/xrRay_constructor.https.html
r258499 r265546 19 19 // Check defaults - should be 0,0,0,1 for origin and 0,0,-1,0 for direction, 20 20 // identity matrix for the transform: 21 let xrRay = new XRRay(); 21 let xrRay1 = new XRRay(); 22 let xrRay2 = new XRRay({}); 23 let xrRay3 = new XRRay({}, {}); 24 22 25 assert_point_approx_equals( 23 xrRay .origin, {x : 0.0, y : 0.0, z : 0.0, w : 1.0},26 xrRay1.origin, {x : 0.0, y : 0.0, z : 0.0, w : 1.0}, 24 27 FLOAT_EPSILON, "origin-default:"); 25 28 assert_point_approx_equals( 26 xrRay .direction, {x : 0.0, y : 0.0, z : -1.0, w : 0.0},29 xrRay1.direction, {x : 0.0, y : 0.0, z : -1.0, w : 0.0}, 27 30 FLOAT_EPSILON, "direction-default:"); 28 31 assert_matrix_approx_equals( 29 xrRay .matrix, IDENTITY_MATRIX,32 xrRay1.matrix, IDENTITY_MATRIX, 30 33 FLOAT_EPSILON, "matrix-default:"); 34 35 assert_ray_approx_equals(xrRay1, xrRay2, FLOAT_EPSILON, "ray1-ray2-default:"); 36 assert_ray_approx_equals(xrRay2, xrRay3, FLOAT_EPSILON, "ray2-ray3-default:"); 31 37 } 32 38 … … 34 40 // Check custom value for origin, default for direction: 35 41 let originDict = {x : 11.0, y : 12.0, z : 13.0, w : 1.0}; 42 let xrRay1 = new XRRay(originDict); 36 43 let xrRay2 = new XRRay(DOMPoint.fromPoint(originDict)); 37 44 let xrRay3 = new XRRay(DOMPointReadOnly.fromPoint(originDict)); … … 42 49 43 50 assert_point_approx_equals( 44 xrRay 2.origin, originDict,51 xrRay1.origin, originDict, 45 52 FLOAT_EPSILON, "origin-custom-direction-default:"); 46 53 assert_point_approx_equals( 47 xrRay 2.direction, {x : 0.0, y : 0.0, z : -1.0, w : 0.0},54 xrRay1.direction, {x : 0.0, y : 0.0, z : -1.0, w : 0.0}, 48 55 FLOAT_EPSILON, "direction-custom-direction-default:"); 49 56 assert_matrix_approx_equals( 50 xrRay 2.matrix, matrix1,57 xrRay1.matrix, matrix1, 51 58 FLOAT_EPSILON, "matrix-custom-direction-default:"); 52 59 60 assert_ray_approx_equals(xrRay1, xrRay2, FLOAT_EPSILON, "ray1-ray2-direction-default:"); 53 61 assert_ray_approx_equals(xrRay2, xrRay3, FLOAT_EPSILON, "ray2-ray3-direction-default:"); 54 62 } … … 68 76 10, 10, 10, 1]; 69 77 78 let xrRay1 = new XRRay( 79 originDict, 80 directionDict); 81 70 82 let xrRay2 = new XRRay( 71 83 DOMPoint.fromPoint(originDict), … … 77 89 78 90 assert_point_approx_equals( 79 xrRay 2.origin, originDict,91 xrRay1.origin, originDict, 80 92 FLOAT_EPSILON, "origin-custom:"); 81 93 assert_point_approx_equals( 82 xrRay 2.direction, directionNorm,94 xrRay1.direction, directionNorm, 83 95 FLOAT_EPSILON, "direction-custom:"); 84 96 assert_matrix_approx_equals( 85 xrRay 2.matrix, matrix1,97 xrRay1.matrix, matrix1, 86 98 FLOAT_EPSILON, "matrix-custom:"); 87 99 100 assert_ray_approx_equals(xrRay1, xrRay2, FLOAT_EPSILON, "ray1-ray2:"); 88 101 assert_ray_approx_equals(xrRay2, xrRay3, FLOAT_EPSILON, "ray2-ray3:"); 89 102 } … … 92 105 // Check that we throw exception on direction too close to 0,0,0: 93 106 let originDict = {x : 10.0, y : 10.0, z : 10.0, w : 1.0}; 94 let directionDict = {x : 0.0, y : 0.0, z : 0.0, w : 0.0};107 let directionDict = {x : 1.0, y : 0.0, z : 0.0, w : 0.0}; 95 108 96 try { 97 let xrRay = new XRRay( 109 assert_throws_js(TypeError, () => new XRRay( 98 110 DOMPoint.fromPoint(originDict), 99 DOMPoint.fromPoint(directionDict)); 111 DOMPoint.fromPoint({x : 0.0, y : 0.0, z : 0.0, w : 0.0}) 112 ), "Constructor should throw for zero direction"); 100 113 101 assert(false, "origin-custom-direction-zero:exception not thrown"); 102 } 103 catch(e) 104 { 105 if(e instanceof DOMException) { 106 assert_equals(e.name, "InvalidStateError", "origin-custom-direction-zero:incorrect DOM exception thrown"); 107 } else { 108 assert(false, "origin-custom-direction-zero:other exception thrown: " + e); 109 } 110 } 114 assert_throws_js(TypeError, () => new XRRay( 115 DOMPoint.fromPoint(originDict), 116 DOMPoint.fromPoint({x : 1.0, y : 0.0, z : 0.0, w : 0.5}) 117 ), "Constructor should throw for nonzero direction w coordinate"); 118 119 assert_throws_js(TypeError, () => new XRRay( 120 DOMPoint.fromPoint({x : 10.0, y : 10.0, z : 10.0, w : 0.5}), 121 DOMPoint.fromPoint(directionDict) 122 ), "Constructor should throw for non-1 origin w coordinate"); 111 123 } 112 124 … … 125 137 10., 10, 10., 1]; 126 138 127 let xrRay 4= new XRRay(139 let xrRay = new XRRay( 128 140 new XRRigidTransform( 129 141 DOMPoint.fromPoint(originDict), … … 131 143 132 144 assert_point_approx_equals( 133 xrRay 4.origin, originDict,145 xrRay.origin, originDict, 134 146 FLOAT_EPSILON, "origin-custom-rigid:"); 135 147 assert_point_approx_equals( 136 xrRay 4.direction, directionNorm2,148 xrRay.direction, directionNorm2, 137 149 FLOAT_EPSILON, "direction-custom-rigid:"); 138 150 139 151 assert_matrix_approx_equals( 140 xrRay 4.matrix, matrix2,152 xrRay.matrix, matrix2, 141 153 FLOAT_EPSILON, "matrix-custom-rigid:"); 142 154 } -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/idlharness.https.window-expected.txt
r265239 r265546 51 51 PASS XRSession interface: attribute onsqueezeend 52 52 PASS XRSession interface: attribute onvisibilitychange 53 PASS XRSession must be primary interface of xrSession 54 PASS Stringification of xrSession 55 PASS XRSession interface: xrSession must inherit property "visibilityState" with the proper type 56 PASS XRSession interface: xrSession must inherit property "renderState" with the proper type 57 PASS XRSession interface: xrSession must inherit property "inputSources" with the proper type 58 PASS XRSession interface: xrSession must inherit property "updateRenderState(optional XRRenderStateInit)" with the proper type 59 PASS XRSession interface: calling updateRenderState(optional XRRenderStateInit) on xrSession with too few arguments must throw TypeError 60 PASS XRSession interface: xrSession must inherit property "requestReferenceSpace(XRReferenceSpaceType)" with the proper type 61 PASS XRSession interface: calling requestReferenceSpace(XRReferenceSpaceType) on xrSession with too few arguments must throw TypeError 62 PASS XRSession interface: xrSession must inherit property "requestAnimationFrame(XRFrameRequestCallback)" with the proper type 63 PASS XRSession interface: calling requestAnimationFrame(XRFrameRequestCallback) on xrSession with too few arguments must throw TypeError 64 PASS XRSession interface: xrSession must inherit property "cancelAnimationFrame(unsigned long)" with the proper type 65 PASS XRSession interface: calling cancelAnimationFrame(unsigned long) on xrSession with too few arguments must throw TypeError 66 PASS XRSession interface: xrSession must inherit property "end()" with the proper type 67 PASS XRSession interface: xrSession must inherit property "onend" with the proper type 68 PASS XRSession interface: xrSession must inherit property "oninputsourceschange" with the proper type 69 PASS XRSession interface: xrSession must inherit property "onselect" with the proper type 70 PASS XRSession interface: xrSession must inherit property "onselectstart" with the proper type 71 PASS XRSession interface: xrSession must inherit property "onselectend" with the proper type 72 PASS XRSession interface: xrSession must inherit property "onsqueeze" with the proper type 73 PASS XRSession interface: xrSession must inherit property "onsqueezestart" with the proper type 74 PASS XRSession interface: xrSession must inherit property "onsqueezeend" with the proper type 75 PASS XRSession interface: xrSession must inherit property "onvisibilitychange" with the proper type 53 76 PASS XRRenderState interface: existence and properties of interface object 54 77 PASS XRRenderState interface object length … … 61 84 PASS XRRenderState interface: attribute inlineVerticalFieldOfView 62 85 PASS XRRenderState interface: attribute baseLayer 86 PASS XRRenderState must be primary interface of xrRenderState 87 PASS Stringification of xrRenderState 88 PASS XRRenderState interface: xrRenderState must inherit property "depthNear" with the proper type 89 PASS XRRenderState interface: xrRenderState must inherit property "depthFar" with the proper type 90 PASS XRRenderState interface: xrRenderState must inherit property "inlineVerticalFieldOfView" with the proper type 91 PASS XRRenderState interface: xrRenderState must inherit property "baseLayer" with the proper type 63 92 PASS XRFrame interface: existence and properties of interface object 64 93 PASS XRFrame interface object length … … 84 113 PASS XRReferenceSpace interface: operation getOffsetReferenceSpace(XRRigidTransform) 85 114 PASS XRReferenceSpace interface: attribute onreset 115 PASS XRReferenceSpace must be primary interface of xrReferenceSpace 116 PASS Stringification of xrReferenceSpace 117 PASS XRReferenceSpace interface: xrReferenceSpace must inherit property "getOffsetReferenceSpace(XRRigidTransform)" with the proper type 118 PASS XRReferenceSpace interface: calling getOffsetReferenceSpace(XRRigidTransform) on xrReferenceSpace with too few arguments must throw TypeError 119 PASS XRReferenceSpace interface: xrReferenceSpace must inherit property "onreset" with the proper type 86 120 PASS XRBoundedReferenceSpace interface: existence and properties of interface object 87 121 PASS XRBoundedReferenceSpace interface object length … … 120 154 PASS XRRigidTransform interface: attribute matrix 121 155 PASS XRRigidTransform interface: attribute inverse 156 PASS XRRigidTransform must be primary interface of new XRRigidTransform() 157 PASS Stringification of new XRRigidTransform() 158 PASS XRRigidTransform interface: new XRRigidTransform() must inherit property "position" with the proper type 159 PASS XRRigidTransform interface: new XRRigidTransform() must inherit property "orientation" with the proper type 160 PASS XRRigidTransform interface: new XRRigidTransform() must inherit property "matrix" with the proper type 161 PASS XRRigidTransform interface: new XRRigidTransform() must inherit property "inverse" with the proper type 122 162 PASS XRPose interface: existence and properties of interface object 123 163 PASS XRPose interface object length … … 154 194 PASS XRInputSourceArray interface: iterable<XRInputSource> 155 195 PASS XRInputSourceArray interface: attribute length 196 PASS XRInputSourceArray must be primary interface of xrInputSourceArray 197 PASS Stringification of xrInputSourceArray 198 PASS XRInputSourceArray interface: xrInputSourceArray must inherit property "length" with the proper type 156 199 PASS XRLayer interface: existence and properties of interface object 157 200 PASS XRLayer interface object length … … 173 216 PASS XRWebGLLayer interface: operation getViewport(XRView) 174 217 PASS XRWebGLLayer interface: operation getNativeFramebufferScaleFactor(XRSession) 218 PASS XRWebGLLayer must be primary interface of xrWebGLLayer 219 PASS Stringification of xrWebGLLayer 220 PASS XRWebGLLayer interface: xrWebGLLayer must inherit property "antialias" with the proper type 221 PASS XRWebGLLayer interface: xrWebGLLayer must inherit property "ignoreDepthValues" with the proper type 222 PASS XRWebGLLayer interface: xrWebGLLayer must inherit property "framebuffer" with the proper type 223 PASS XRWebGLLayer interface: xrWebGLLayer must inherit property "framebufferWidth" with the proper type 224 PASS XRWebGLLayer interface: xrWebGLLayer must inherit property "framebufferHeight" with the proper type 225 PASS XRWebGLLayer interface: xrWebGLLayer must inherit property "getViewport(XRView)" with the proper type 226 PASS XRWebGLLayer interface: calling getViewport(XRView) on xrWebGLLayer with too few arguments must throw TypeError 227 PASS XRWebGLLayer interface: xrWebGLLayer must inherit property "getNativeFramebufferScaleFactor(XRSession)" with the proper type 228 PASS XRWebGLLayer interface: calling getNativeFramebufferScaleFactor(XRSession) on xrWebGLLayer with too few arguments must throw TypeError 175 229 PASS XRSessionEvent interface: existence and properties of interface object 176 230 PASS XRSessionEvent interface object length … … 180 234 PASS XRSessionEvent interface: existence and properties of interface prototype object's @@unscopables property 181 235 PASS XRSessionEvent interface: attribute session 236 PASS XRSessionEvent must be primary interface of xrSessionEvent 237 PASS Stringification of xrSessionEvent 238 PASS XRSessionEvent interface: xrSessionEvent must inherit property "session" with the proper type 182 239 PASS XRInputSourceEvent interface: existence and properties of interface object 183 240 PASS XRInputSourceEvent interface object length … … 197 254 PASS XRInputSourcesChangeEvent interface: attribute added 198 255 PASS XRInputSourcesChangeEvent interface: attribute removed 256 PASS XRInputSourcesChangeEvent must be primary interface of xrInputSourcesChangeEvent 257 PASS Stringification of xrInputSourcesChangeEvent 258 PASS XRInputSourcesChangeEvent interface: xrInputSourcesChangeEvent must inherit property "session" with the proper type 259 PASS XRInputSourcesChangeEvent interface: xrInputSourcesChangeEvent must inherit property "added" with the proper type 260 PASS XRInputSourcesChangeEvent interface: xrInputSourcesChangeEvent must inherit property "removed" with the proper type 199 261 PASS XRReferenceSpaceEvent interface: existence and properties of interface object 200 262 PASS XRReferenceSpaceEvent interface object length … … 212 274 FAIL XRPermissionStatus interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "XRPermissionStatus" expected property "XRPermissionStatus" missing 213 275 FAIL XRPermissionStatus interface: attribute granted assert_own_property: self does not have own property "XRPermissionStatus" expected property "XRPermissionStatus" missing 276 PASS WebGLRenderingContextBase interface: webGLRenderingContextBase must inherit property "makeXRCompatible()" with the proper type 214 277 PASS Navigator interface: attribute xr 215 278 PASS Navigator interface: navigator must inherit property "xr" with the proper type -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/idlharness.https.window.js
r258499 r265546 1 1 // META: script=/resources/WebIDLParser.js 2 2 // META: script=/resources/idlharness.js 3 // META: timeout=long 3 4 4 5 'use strict'; … … 8 9 idl_test( 9 10 ['webxr'], 10 ['permissions', 'webgl1', ' html', 'dom'],11 ['permissions', 'webgl1', 'geometry', 'html', 'dom'], 11 12 async idl_array => { 12 13 idl_array.add_objects({ 13 14 Navigator: ['navigator'], 14 15 XR: ['navigator.xr'], 16 // TODO: XRSystem 17 XRSession: ['xrSession'], 18 XRRenderState: ['xrRenderState'], 19 // TODO: XRFrame 20 // TODO: XRSpace 21 XRReferenceSpace: ['xrReferenceSpace'], 22 // TODO: XRBoundedReferenceSpace 23 // TODO: XRView 24 // TODO: XRViewport 25 XRRigidTransform: ['new XRRigidTransform()'], 26 // TODO: XRPose 27 // TODO: XRViewerPose 28 // TODO: XRInputSource 29 XRInputSourceArray: ['xrInputSourceArray'], 30 XRWebGLLayer: ['xrWebGLLayer'], 31 WebGLRenderingContextBase: ['webGLRenderingContextBase'], 32 XRSessionEvent: ['xrSessionEvent'], 33 // TODO: XRInputSourceEvent 34 XRInputSourcesChangeEvent: ['xrInputSourcesChangeEvent'], 35 // TODO: XRReferenceSpaceEvent 36 // TODO: XRPermissionStatus 15 37 }); 38 39 self.xrSession = await navigator.xr.requestSession('inline'); 40 self.xrRenderState = self.xrSession.renderState; 41 self.xrReferenceSpace = await self.xrSession.requestReferenceSpace('viewer'); 42 self.xrInputSourceArray = self.xrSession.inputSources; 43 self.xrSessionEvent = new XRSessionEvent('end', {session: self.xrSession}); 44 self.xrInputSourcesChangeEvent = new XRInputSourcesChangeEvent('inputsourceschange', { 45 session: self.xrSession, 46 added: [], 47 removed: [], 48 }); 49 50 // XRWebGLRenderingContext is a typedef to either WebGLRenderingContext or WebGL2RenderingContext. 51 const canvas = document.createElement('canvas'); 52 self.webGLRenderingContextBase = canvas.getContext('webgl'); 53 self.xrWebGLLayer = new XRWebGLLayer(self.xrSession, self.webGLRenderingContextBase); 16 54 } 17 55 ); -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants.js
r260936 r265546 49 49 50 50 // A valid input pointer offset for when we don't care about specific values 51 const VALID_POINTER _OFFSET= [1, 0, 0, 0,52 53 54 51 const VALID_POINTER = [1, 0, 0, 0, 52 0, 1, 0, 0, 53 0, 0, 1, 0, 54 0, 0, 1, 1]; 55 55 56 56 const VALID_POINTER_TRANSFORM = { … … 58 58 orientation: [0, 0, 0, 1] 59 59 }; 60 61 const VALID_GRIP_WITH_POINTER_OFFSET = [1, 0, 0, 0,62 0, 1, 0, 0,63 0, 0, 1, 0,64 4, 3, 3, 1];65 60 66 61 // A Valid Local to floor matrix/transform for when we don't care about specific … … 130 125 'dom-overlay', 131 126 'light-estimation', 127 'anchors', 132 128 ]; 133 129 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_util.js
r260936 r265546 1 'use strict'; 2 1 3 // These tests rely on the User Agent providing an implementation of the 2 4 // WebXR Testing API (https://github.com/immersive-web/webxr-test-api). … … 10 12 // Debugging message helper, by default does nothing. Implementations can 11 13 // override this. 12 var xr_debug = function(name, msg) {} 13 var isChromiumBased = 'MojoInterfaceInterceptor' in self; 14 var isWebKitBased = 'internals' in self && 'xrTest' in internals; 14 var xr_debug = function(name, msg) {}; 15 15 16 16 function xr_promise_test(name, func, properties) { … … 19 19 xr_debug(name, 'setup'); 20 20 21 if (isChromiumBased) { 22 // Chrome setup 23 await loadChromiumResources; 24 xr_debug = navigator.xr.test.Debug; 21 // Only set up once. 22 if (!navigator.xr.test) { 23 // Load test-only API helpers. 24 const script = document.createElement('script'); 25 script.src = '/resources/test-only-api.js'; 26 script.async = false; 27 const p = new Promise((resolve, reject) => { 28 script.onload = () => { resolve(); }; 29 script.onerror = e => { reject(e); }; 30 }) 31 document.head.appendChild(script); 32 await p; 33 34 if (isChromiumBased) { 35 // Chrome setup 36 await loadChromiumResources(); 37 } else if (isWebKitBased) { 38 // WebKit setup 39 await setupWebKitWebXRTestAPI(); 40 } else { 41 assert_implements(false, "missing navigator.xr.test"); 42 } 25 43 } 26 44 27 if (isWebKitBased) { 28 // WebKit setup 29 await setupWebKitWebXRTestAPI; 45 // Either the test api needs to be polyfilled and it's not set up above, or 46 // something happened to one of the known polyfills and it failed to be 47 // setup properly. Either way, the fact that xr_promise_test is being used 48 // means that the tests expect navigator.xr.test to be set. By rejecting now 49 // we can hopefully provide a clearer indication of what went wrong. 50 if (!navigator.xr.test) { 51 // We can't use assert_true here because it causes the wpt testharness 52 // to treat this as a test page and not as a test. 53 return Promise.reject("No navigator.xr.test object found, even after attempted load"); 30 54 } 31 55 … … 43 67 return func(t); 44 68 }, name, properties); 69 } 70 71 // A utility function for waiting one animation frame before running the callback 72 // 73 // This is only needed after calling FakeXRDevice methods outside of an animation frame 74 // 75 // This is so that we can paper over the potential race allowed by the "next animation frame" 76 // concept https://immersive-web.github.io/webxr-test-api/#xrsession-next-animation-frame 77 function requestSkipAnimationFrame(session, callback) { 78 session.requestAnimationFrame(() => { 79 session.requestAnimationFrame(callback); 80 }); 45 81 } 46 82 … … 150 186 callback(window.XRPresentationContext, 'XRPresentationContext'); 151 187 callback(window.XRFrame, 'XRFrame'); 188 callback(window.XRLayer, 'XRLayer'); 152 189 callback(window.XRView, 'XRView'); 153 190 callback(window.XRViewport, 'XRViewport'); … … 163 200 164 201 // Code for loading test API in Chromium. 165 let loadChromiumResources = Promise.resolve().then(() => { 166 if (!isChromiumBased) { 167 // Do nothing on non-Chromium-based browsers or when the Mojo bindings are 168 // not present in the global namespace. 169 return; 170 } 171 202 async function loadChromiumResources() { 172 203 let chromiumResources = [ 173 '/gen/layout_test_data/mojo/public/js/mojo_bindings.js',174 204 '/gen/mojo/public/mojom/base/time.mojom.js', 205 '/gen/mojo/public/mojom/base/shared_memory.mojom.js', 206 '/gen/mojo/public/mojom/base/unguessable_token.mojom.js', 207 '/gen/gpu/ipc/common/sync_token.mojom.js', 208 '/gen/gpu/ipc/common/mailbox.mojom.js', 175 209 '/gen/gpu/ipc/common/mailbox_holder.mojom.js', 176 '/gen/gpu/ipc/common/sync_token.mojom.js',177 '/gen/ui/display/mojom/display.mojom.js',178 210 '/gen/ui/gfx/geometry/mojom/geometry.mojom.js', 211 '/gen/ui/gfx/mojom/native_handle_types.mojom.js', 212 '/gen/ui/gfx/mojom/buffer_types.mojom.js', 213 '/gen/ui/gfx/mojom/color_space.mojom.js', 214 '/gen/ui/gfx/mojom/display_color_spaces.mojom.js', 179 215 '/gen/ui/gfx/mojom/gpu_fence_handle.mojom.js', 180 216 '/gen/ui/gfx/mojom/transform.mojom.js', 217 '/gen/ui/display/mojom/display.mojom.js', 218 '/gen/device/gamepad/public/mojom/gamepad.mojom.js', 181 219 '/gen/device/vr/public/mojom/vr_service.mojom.js', 182 220 '/resources/chromium/webxr-test-math-helper.js', 183 221 '/resources/chromium/webxr-test.js', 222 // Required only by resources/chromium/webxr-test.js 184 223 '/resources/testdriver.js', 185 224 '/resources/testdriver-vendor.js', … … 194 233 } 195 234 196 let chain = Promise.resolve(); 197 chromiumResources.forEach(path => { 198 let script = document.createElement('script'); 199 script.src = path; 200 script.async = false; 201 chain = chain.then(() => new Promise(resolve => { 202 script.onload = () => resolve(); 203 })); 204 document.head.appendChild(script); 205 }); 206 207 return chain; 208 }); 209 210 let setupWebKitWebXRTestAPI = Promise.resolve().then(() => { 211 if (!isWebKitBased) { 212 // Do nothing on non-WebKit-based browsers. 213 return; 214 } 215 235 await loadMojoResources(chromiumResources); 236 237 xr_debug = navigator.xr.test.Debug; 238 } 239 240 function setupWebKitWebXRTestAPI() { 216 241 // WebKit setup. The internals object is used by the WebKit test runner 217 242 // to provide JS access to internal APIs. In this case it's used to … … 219 244 navigator.xr.test = internals.xrTest; 220 245 return Promise.resolve(); 221 } );246 } -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/w3c-import.log
r258499 r265546 29 29 /LayoutTests/imported/w3c/web-platform-tests/webxr/idlharness.https.window.js 30 30 /LayoutTests/imported/w3c/web-platform-tests/webxr/navigator_xr_sameObject.https.html 31 /LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_update.https.html 31 32 /LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_vertical_fov_immersive.https.html 32 33 /LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_vertical_fov_inline.https.html 33 34 /LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https.html 34 35 /LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https.html 36 /LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html 35 37 /LayoutTests/imported/w3c/web-platform-tests/webxr/webxr-supported-by-feature-policy.html 36 38 /LayoutTests/imported/w3c/web-platform-tests/webxr/webxr_availability.http.sub.html … … 61 63 /LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffsetBounded.https.html 62 64 /LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset_viewer.https.html 65 /LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_relationships.https.html 63 66 /LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_constructor.https.html 64 67 /LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_inverse.https.html -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https.html
r258499 r265546 9 9 xr_promise_test("An XR-compatible webglCanvasContext can be created", 10 10 (t) => { 11 let gl = null; 12 let offscreenGl = null; 11 13 return navigator.xr.test.simulateDeviceConnection(TRACKED_IMMERSIVE_DEVICE) 12 14 .then( (controller) => { 13 webglCanvas = document.getElementById('webgl-canvas'); 14 gl = webglCanvas.getContext('webgl', {xrCompatible: true}); 15 let webglCanvas = document.getElementById('webgl-canvas'); 16 gl = webglCanvas.getContext('webgl'); 17 return gl.makeXRCompatible(); 18 }).then( () => { 15 19 assert_true(gl.getContextAttributes().xrCompatible); 16 20 17 21 // Check that an offscreen context behaves no different. 18 let offscreenCanvas = document.createElement('canvas'); 19 let offscreenGl = webglCanvas.getContext( 20 'webgl', {xrCompatible: true}); 21 assert_true(offscreenGl.getContextAttributes().xrCompatible); 22 //let offscreenCanvas = document.createElement('canvas'); 23 //offscreenGl = offscreenCanvas.getContext('webgl'); 24 //return offscreenGl.makeXRCompatible(); 25 }).then( () => { 26 //assert_true(offscreenGl.getContextAttributes().xrCompatible); 22 27 }); 23 28 }); -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https.html
r258499 r265546 14 14 .then( (controller) => { 15 15 webglCanvas = document.getElementById('webgl-canvas'); 16 gl = webglCanvas.getContext('webgl', {xrCompatible: true}); 16 gl = webglCanvas.getContext('webgl'); 17 return gl.makeXRCompatible(); 18 }).then( () => { 17 19 gl.getExtension('WEBGL_lose_context').loseContext(); 18 20 return promise_rejects_dom(t, 'InvalidStateError', gl.makeXRCompatible()); -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrBoundedReferenceSpace_updates.https.html
r258499 r265546 50 50 // Now set the bounds explicitly and check again on the next frame. 51 51 fakeDeviceController.setBoundsGeometry(VALID_BOUNDS); 52 session.requestAnimationFrame(onFrame);52 requestSkipAnimationFrame(session, onFrame); 53 53 }); 54 54 }); -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_add_remove.https.html
r258499 r265546 22 22 let input_source_1 = fakeDeviceController.simulateInputSourceConnection(RIGHT_CONTROLLER); 23 23 24 session.requestAnimationFrame((time, xrFrame) => {24 requestSkipAnimationFrame(session, (time, xrFrame) => { 25 25 let input_sources = session.inputSources; 26 26 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_emulatedPosition.https.html
r258499 r265546 54 54 55 55 // Can only request input poses in an xr frame. 56 session.requestAnimationFrame(CheckPositionNotEmulated);56 requestSkipAnimationFrame(session, CheckPositionNotEmulated); 57 57 }); 58 58 }); -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_profiles.https.html
r258499 r265546 23 23 // are requesting an animation frame before checking the profiles list. 24 24 return new Promise((resolve) => { 25 session.requestAnimationFrame(() => {25 requestSkipAnimationFrame(session, () => { 26 26 let profiles = session.inputSources[0].profiles; 27 27 t.step(() => { -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_sameObject.https.html
r258499 r265546 19 19 }); 20 20 21 session.requestAnimationFrame((time, xrFrame) => {21 requestSkipAnimationFrame(session, (time, xrFrame) => { 22 22 let source = session.inputSources[0]; 23 23 let targetRaySpace = source.targetRaySpace; -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrPose_transform_sameObject.https.html
r258499 r265546 20 20 21 21 session.requestReferenceSpace('local').then((referenceSpace) => { 22 session.requestAnimationFrame((time, xrFrame) => {22 requestSkipAnimationFrame(session, (time, xrFrame) => { 23 23 let source = session.inputSources[0]; 24 24 let input_pose = xrFrame.getPose(source.targetRaySpace, referenceSpace); -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset.https.html
r258499 r265546 43 43 44 44 const POINTER_TRANSFORM_WITH_ROTATION = { 45 position: [ 2, 0, 1],46 orientation: [ 0, 0, 0.7071, 0.7071]45 position: [0, 1, 4], 46 orientation: [-0.5, 0.5, 0.5, -0.5] 47 47 }; 48 48 … … 75 75 let source = session.inputSources[0]; 76 76 77 function CheckState(referenceSpace, expected_view_matrix, expected_grip_matrix, expected_ray_matrix ) {77 function CheckState(referenceSpace, expected_view_matrix, expected_grip_matrix, expected_ray_matrix, prefix) { 78 78 t.step(() => { 79 79 let pose = frame.getViewerPose(referenceSpace); … … 85 85 let ray_matrix = input_pose.transform.matrix; 86 86 87 assert_matrix_approx_equals(view_matrix, expected_view_matrix );88 assert_matrix_approx_equals(grip_matrix, expected_grip_matrix );89 assert_matrix_approx_equals(ray_matrix, expected_ray_matrix );87 assert_matrix_approx_equals(view_matrix, expected_view_matrix, prefix + " view matrix"); 88 assert_matrix_approx_equals(grip_matrix, expected_grip_matrix, prefix + " grip matrix"); 89 assert_matrix_approx_equals(ray_matrix, expected_ray_matrix, prefix + " ray matrix"); 90 90 }); 91 91 } 92 92 93 CheckState(referenceSpace, EXPECTED_VIEW_MATRIX_1, EXPECTED_GRIP_MATRIX_1, EXPECTED_RAY_MATRIX_1 );93 CheckState(referenceSpace, EXPECTED_VIEW_MATRIX_1, EXPECTED_GRIP_MATRIX_1, EXPECTED_RAY_MATRIX_1, "Initial"); 94 94 95 95 const new_position1 = { … … 106 106 107 107 referenceSpace = referenceSpace.getOffsetReferenceSpace(new XRRigidTransform(new_position1, new_orientation1)); 108 CheckState(referenceSpace, EXPECTED_VIEW_MATRIX_2, EXPECTED_GRIP_MATRIX_2, EXPECTED_RAY_MATRIX_2 );108 CheckState(referenceSpace, EXPECTED_VIEW_MATRIX_2, EXPECTED_GRIP_MATRIX_2, EXPECTED_RAY_MATRIX_2, "First transform"); 109 109 110 110 const new_position2 = { … … 121 121 122 122 referenceSpace = referenceSpace.getOffsetReferenceSpace(new XRRigidTransform(new_position2, new_orientation2)); 123 CheckState(referenceSpace, EXPECTED_VIEW_MATRIX_3, EXPECTED_GRIP_MATRIX_3, EXPECTED_RAY_MATRIX_3 );123 CheckState(referenceSpace, EXPECTED_VIEW_MATRIX_3, EXPECTED_GRIP_MATRIX_3, EXPECTED_RAY_MATRIX_3, "Second transform"); 124 124 125 125 resolve(); … … 127 127 128 128 // Can only request input poses in an xr frame. 129 session.requestAnimationFrame(OnFrame);129 requestSkipAnimationFrame(session, OnFrame); 130 130 }); 131 131 }); -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffsetBounded.https.html
r258499 r265546 29 29 30 30 const FLOOR_TRANSFORM = { 31 position: [ 0.1, 0.2,0.3],31 position: [-0.1, -0.2, -0.3], 32 32 orientation: [0, 0, 0, 1] 33 33 }; … … 55 55 56 56 const LOCAL_POINTER_TRANSFORM = { 57 position: [ 0.01, 0.02, 0.03],57 position: [1.01, 2.02, 3.03], 58 58 orientation: [0, 0, 0, 1] 59 59 } … … 68 68 69 69 return new Promise((resolve, reject) => { 70 session.requestAnimationFrame((time, frame) => {70 requestSkipAnimationFrame(session, (time, frame) => { 71 71 let input_source = session.inputSources[0]; 72 72 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_input_events_end.https.html
r258499 r265546 43 43 selectionClicked: true 44 44 }); 45 session.requestAnimationFrame(() => {});45 requestSkipAnimationFrame(session, () => {}); 46 46 } 47 47 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https.html
r258499 r265546 22 22 let frameTime = 0; 23 23 let lastFrameTime = 0; 24 24 25 let firstFrame = true; 25 26 … … 27 28 lastFrameTime = frameTime; 28 29 frameTime = time; 29 firstFrame = false;30 30 let now = performance.now(); 31 31 32 32 t.step( () => { 33 // This callback must be the first one called. 34 assert_equals(counter, 0); 35 36 if (!firstFrame) { 33 if(firstFrame) { 34 // This callback must be the first one called. 35 assert_equals(counter, 0); 36 } else { 37 // If it's a second animation frame, the timestamp must be greater 38 // than the timestamp on a previous frame. 37 39 assert_greater_than(frameTime, lastFrameTime); 40 // ... but not grater than 10 seconds. 38 41 assert_approx_equals(frameTime, lastFrameTime, TEN_SECONDS); 39 42 } … … 47 50 48 51 if (firstFrame) { 52 // We also want this method to run for the second animation frame. 49 53 session.requestAnimationFrame(onFrameFirst); 50 54 } else { … … 52 56 } 53 57 58 firstFrame = false; 54 59 counter++; 55 60 } -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_sameObject.https.html
r258499 r265546 19 19 }); 20 20 21 session.requestAnimationFrame((time, xrFrame) => {21 requestSkipAnimationFrame(session, (time, xrFrame) => { 22 22 let renderState = session.renderState; 23 23 let sources = session.inputSources; -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_visibilityState.https.html
r258499 r265546 17 17 let testFunction = function(session, fakeDeviceController, t) { 18 18 let eventWatcher = new EventWatcher( 19 t, session, ["visibilitychange", " visibilitychange", "framefired", "watcherdone"]);19 t, session, ["visibilitychange", "framefired", "watcherdone"]); 20 20 let eventPromise = eventWatcher.wait_for( 21 21 ["visibilitychange", "visibilitychange", "framefired", "watcherdone"]); -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrStationaryReferenceSpace_floorlevel_updates.https.html
r258499 r265546 37 37 // Need to request one animation frame for the new stage transform to 38 38 // propagate before we check that it's what we expect. 39 session.requestAnimationFrame(() => { 40 session.requestAnimationFrame(onFrame); 41 }); 39 requestSkipAnimationFrame(session, onFrame); 42 40 }); 43 41 } … … 59 57 // Need to wait one frame for the removal to propagate before we check that 60 58 // everything is at the expected emulated position. 61 session.requestAnimationFrame(() => { 62 session.requestAnimationFrame(onFirstFrame); 63 }); 59 requestSkipAnimationFrame(session, onFirstFrame); 64 60 })); 65 61 }; -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_constructor.https.html
r258499 r265546 30 30 return new Promise((resolve) => { 31 31 navigator.xr.test.simulateUserActivation(() => { 32 let xrSession = null; 32 33 navigator.xr.requestSession('immersive-vr') 33 34 .then((session) => { 35 xrSession = session; 34 36 t.step_func(() => { 35 37 try { 36 let webglLayerIncompatible = new XRWebGLLayer( session, gl);38 let webglLayerIncompatible = new XRWebGLLayer(xrSession, gl); 37 39 assert_unreached("XRWebGLLayer should fail when created with a context that is not XRCompatible") 38 40 } catch (err) { … … 41 43 }) 42 44 43 gl.makeXRCompatible();44 45 return gl.makeXRCompatible(); 46 }).then(() => { 45 47 try { 46 let webglLayerGood = new XRWebGLLayer( session, gl);48 let webglLayerGood = new XRWebGLLayer(xrSession, gl); 47 49 } catch (err) { 48 50 reject("XRWebGLLayer should not fail with valid arguments"); … … 55 57 56 58 try { 57 let webglLayerBadContext = new XRWebGLLayer( session, gl);59 let webglLayerBadContext = new XRWebGLLayer(xrSession, gl); 58 60 reject("XRWebGLLayer should fail when created with a lost context"); 59 61 } catch (err) { … … 64 66 65 67 webglCanvas.addEventListener('webglcontextrestored', (ev) => { 66 resolve( session.end().then(() => {68 resolve(xrSession.end().then(() => { 67 69 try { 68 let webglLayerBadSession = new XRWebGLLayer( session, gl);70 let webglLayerBadSession = new XRWebGLLayer(xrSession, gl); 69 71 assert_unreached("XRWebGLLayer should fail when created with an ended session"); 70 72 } catch (err) { -
trunk/LayoutTests/platform/wpe/TestExpectations
r265486 r265546 895 895 # WebXR 896 896 webkit.org/b/212897 imported/w3c/web-platform-tests/webxr/idlharness.https.window.html [ Pass ] 897 webkit.org/b/209859 imported/w3c/web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https.html [ Pass ]898 897 webkit.org/b/209859 imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https.html [ Pass ] 899 898 webkit.org/b/209859 imported/w3c/web-platform-tests/webxr/xrDevice_isSessionSupported_inline.https.html [ Pass ] -
trunk/Source/WebCore/ChangeLog
r265545 r265546 1 2020-08-06 Sergio Villar Senin <svillar@igalia.com> 2 3 [WebXR] Update WebXR WPT directory 4 https://bugs.webkit.org/show_bug.cgi?id=215224 5 6 Reviewed by Youenn Fablet. 7 8 The update of the WebXR WPT directory helped us to unveil a couple of mistakes in the current code. 9 First of all the Events defined in the WebXR spec had to be iso allocated as the Event base class. 10 Secondly the WebXRInputSourceArray must have a ::create() method. Finally the m_inputSources attribute 11 of the WebXRSession must be a Ref instead of a RefPtr because the specs mention that the initial 12 value is an empty array. 13 14 Tests: imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_create_move.https.html 15 imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_delay_creation.https.html 16 imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_failure.https.html 17 imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_pause_resume_stop.https.html 18 imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_states.https.html 19 imported/w3c/web-platform-tests/webxr/anchors/idlharness.https.window.html 20 imported/w3c/web-platform-tests/webxr/dom-overlay/ar_dom_overlay_hit_test.https.html 21 imported/w3c/web-platform-tests/webxr/dom-overlay/idlharness.https.window.html 22 imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_inputSources.https.html 23 imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_regular.https.html 24 imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_transient.https.html 25 imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_transientInputSources.https.html 26 imported/w3c/web-platform-tests/webxr/hit-test/idlharness.https.html 27 imported/w3c/web-platform-tests/webxr/render_state_update.https.html 28 imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html 29 imported/w3c/web-platform-tests/webxr/xrReferenceSpace_relationships.https.html 30 31 * Modules/webxr/WebXRInputSourceArray.cpp: 32 (WebCore::WebXRInputSourceArray::create): Added. 33 * Modules/webxr/WebXRInputSourceArray.h: 34 * Modules/webxr/WebXRSession.cpp: 35 (WebCore::WebXRSession::WebXRSession): Initialize the m_inputSources. 36 (WebCore::WebXRSession::inputSources const): Return a const reference. 37 * Modules/webxr/WebXRSession.h: 38 * Modules/webxr/XRInputSourcesChangeEvent.cpp: Make it iso allocated. 39 * Modules/webxr/XRInputSourcesChangeEvent.h: Ditto. 40 * Modules/webxr/XRSessionEvent.cpp: Ditto. 41 * Modules/webxr/XRSessionEvent.h: Ditto. 42 1 43 2020-08-12 Antti Koivisto <antti@apple.com> 2 44 -
trunk/Source/WebCore/Modules/webxr/WebXRInputSourceArray.cpp
r258498 r265546 30 30 31 31 #include <wtf/IsoMallocInlines.h> 32 #include <wtf/Ref.h> 32 33 33 34 namespace WebCore { -
trunk/Source/WebCore/Modules/webxr/WebXRInputSourceArray.h
r261863 r265546 38 38 WTF_MAKE_ISO_ALLOCATED(WebXRInputSourceArray); 39 39 public: 40 static Ref<WebXRInputSourceArray> create() { return adoptRef(*new WebXRInputSourceArray()); } 41 ~WebXRInputSourceArray() = default; 42 40 43 unsigned length() const; 41 44 WebXRInputSource* item(unsigned) const; 42 45 43 46 private: 44 WebXRInputSourceArray() ;47 WebXRInputSourceArray() = default; 45 48 }; 46 49 -
trunk/Source/WebCore/Modules/webxr/WebXRSession.cpp
r265137 r265546 47 47 WebXRSession::WebXRSession(Document& document, WebXRSystem& system, XRSessionMode mode, PlatformXR::Device& device) 48 48 : ActiveDOMObject(&document) 49 , m_inputSources(WebXRInputSourceArray::create()) 49 50 , m_xrSystem(system) 50 51 , m_mode(mode) … … 82 83 const WebXRInputSourceArray& WebXRSession::inputSources() const 83 84 { 84 return *m_inputSources;85 return m_inputSources; 85 86 } 86 87 -
trunk/Source/WebCore/Modules/webxr/WebXRSession.h
r264215 r265546 110 110 XRInteractionMode m_interactionMode; 111 111 XRVisibilityState m_visibilityState; 112 Ref Ptr<WebXRInputSourceArray> m_inputSources;112 Ref<WebXRInputSourceArray> m_inputSources; 113 113 bool m_ended { false }; 114 114 -
trunk/Source/WebCore/Modules/webxr/XRInputSourcesChangeEvent.cpp
r258498 r265546 31 31 #include "WebXRInputSource.h" 32 32 #include "WebXRSession.h" 33 #include <wtf/IsoMallocInlines.h> 33 34 34 35 namespace WebCore { 36 37 WTF_MAKE_ISO_ALLOCATED_IMPL(XRInputSourcesChangeEvent); 35 38 36 39 Ref<XRInputSourcesChangeEvent> XRInputSourcesChangeEvent::create(const AtomString& type, const Init& initializer, IsTrusted isTrusted) -
trunk/Source/WebCore/Modules/webxr/XRInputSourcesChangeEvent.h
r258498 r265546 38 38 39 39 class XRInputSourcesChangeEvent final : public Event { 40 WTF_MAKE_ISO_ALLOCATED(XRInputSourcesChangeEvent); 40 41 public: 41 42 struct Init : EventInit { -
trunk/Source/WebCore/Modules/webxr/XRSessionEvent.cpp
r258498 r265546 29 29 #if ENABLE(WEBXR) 30 30 31 #include <wtf/IsoMallocInlines.h> 31 32 #include "WebXRSession.h" 32 33 33 34 namespace WebCore { 35 36 WTF_MAKE_ISO_ALLOCATED_IMPL(XRSessionEvent); 34 37 35 38 Ref<XRSessionEvent> XRSessionEvent::create(const AtomString& type, const Init& initializer, IsTrusted isTrusted) -
trunk/Source/WebCore/Modules/webxr/XRSessionEvent.h
r258498 r265546 35 35 36 36 class XRSessionEvent final : public Event { 37 WTF_MAKE_ISO_ALLOCATED(XRSessionEvent); 37 38 public: 38 39 struct Init : EventInit {
Note: See TracChangeset
for help on using the changeset viewer.