WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-224935-20210524140056.patch (text/plain), 263.79 KB, created by
Imanol Fernandez
on 2021-05-24 05:00:58 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Imanol Fernandez
Created:
2021-05-24 05:00:58 PDT
Size:
263.79 KB
patch
obsolete
>Subversion Revision: 277947 >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index c2403687bc3dcaadfe76bf9cf98630be4eadb02e..9d39ec6d581fd946a002f61ff4cd53e356e2bbc2 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,222 @@ >+2021-05-24 Imanol Fernandez <ifernandez@igalia.com> >+ >+ Update WebXR WPT tests >+ https://bugs.webkit.org/show_bug.cgi?id=224935 >+ <rdar://problem/77323099> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * resources/import-expectations.json: >+ * web-platform-tests/webxr/META.yml: >+ * web-platform-tests/webxr/anchors/META.yml: Added. >+ * web-platform-tests/webxr/anchors/ar_anchor_freefloating_create_move.https.html: >+ * web-platform-tests/webxr/anchors/ar_anchor_freefloating_delay_creation.https.html: >+ * web-platform-tests/webxr/anchors/ar_anchor_freefloating_failure.https.html: >+ * web-platform-tests/webxr/anchors/ar_anchor_freefloating_pause_resume_stop.https.html: >+ * web-platform-tests/webxr/anchors/ar_anchor_states.https.html: >+ * web-platform-tests/webxr/anchors/w3c-import.log: >+ * web-platform-tests/webxr/ar-module/META.yml: Added. >+ * web-platform-tests/webxr/ar-module/w3c-import.log: >+ * web-platform-tests/webxr/ar-module/xrDevice_requestSession_immersive-ar.https-expected.txt: >+ * web-platform-tests/webxr/ar-module/xrDevice_requestSession_immersive-ar.https.html: >+ * web-platform-tests/webxr/ar-module/xrSession_environmentBlendMode.https.html: >+ * web-platform-tests/webxr/ar-module/xrSession_interactionMode.https.html: Added. >+ * web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_dataUnavailable.https.html: Added. >+ * web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_inactiveFrame.https.html: Added. >+ * web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_incorrectUsage.https.html: Added. >+ * web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_luminance_alpha_dataValid.https.html: Added. >+ * web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_staleView.https.html: Added. >+ * web-platform-tests/webxr/depth-sensing/cpu/w3c-import.log: Added. >+ * web-platform-tests/webxr/depth-sensing/dataUnavailableTests.js: Added. >+ (return.session.requestReferenceSpace.then): >+ (const.dataUnavailableTestFunctionGenerator): >+ * web-platform-tests/webxr/depth-sensing/depth_sensing_notEnabled.https.html: Added. >+ * web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_dataUnavailable.https.html: Added. >+ * web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_inactiveFrame.https.html: Added. >+ * web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_incorrectUsage.https.html: Added. >+ * web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_staleView.https.html: Added. >+ * web-platform-tests/webxr/depth-sensing/gpu/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/w3c-import.log. >+ * web-platform-tests/webxr/depth-sensing/inactiveFrameTests.js: Added. >+ (return.session.requestReferenceSpace.then): >+ (const.inactiveFrameTestFunctionGenerator): >+ * web-platform-tests/webxr/depth-sensing/staleViewsTests.js: Added. >+ (return.session.requestReferenceSpace.then): >+ (const.staleViewsTestFunctionGenerator): >+ * web-platform-tests/webxr/depth-sensing/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/w3c-import.log. >+ * web-platform-tests/webxr/dom-overlay/META.yml: Added. >+ * web-platform-tests/webxr/dom-overlay/ar_dom_overlay.https.html: >+ * web-platform-tests/webxr/dom-overlay/idlharness.https.window.js: >+ (async idl_array): >+ * web-platform-tests/webxr/dom-overlay/nested_fullscreen.https.html: Added. >+ * web-platform-tests/webxr/dom-overlay/w3c-import.log: >+ * web-platform-tests/webxr/events_input_source_recreation.https-expected.txt: >+ * web-platform-tests/webxr/events_input_source_recreation.https.html: >+ * web-platform-tests/webxr/events_input_sources_change.https-expected.txt: >+ * web-platform-tests/webxr/events_input_sources_change.https.html: >+ * web-platform-tests/webxr/events_referenceSpace_reset_immersive.https.html: >+ * web-platform-tests/webxr/events_referenceSpace_reset_inline.https.html: >+ * web-platform-tests/webxr/events_session_select.https-expected.txt: >+ * web-platform-tests/webxr/events_session_select.https.html: >+ * web-platform-tests/webxr/events_session_select_subframe.https-expected.txt: >+ * web-platform-tests/webxr/events_session_select_subframe.https.html: >+ * web-platform-tests/webxr/events_session_squeeze.https-expected.txt: >+ * web-platform-tests/webxr/events_session_squeeze.https.html: >+ * web-platform-tests/webxr/exclusive_requestFrame_nolayer.https.html: >+ * web-platform-tests/webxr/gamepads-module/META.yml: Added. >+ * web-platform-tests/webxr/gamepads-module/w3c-import.log: >+ * web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_disconnect.https.html: >+ * web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_input_registered.https.html: >+ * web-platform-tests/webxr/getInputPose_handedness.https-expected.txt: >+ * web-platform-tests/webxr/getInputPose_handedness.https.html: >+ * web-platform-tests/webxr/getInputPose_pointer.https.html: >+ * web-platform-tests/webxr/getViewerPose_emulatedPosition.https-expected.txt: >+ * web-platform-tests/webxr/getViewerPose_emulatedPosition.https.html: >+ * web-platform-tests/webxr/hand-input/META.yml: Added. >+ * web-platform-tests/webxr/hand-input/idlharness.https.window.html: Added. >+ * web-platform-tests/webxr/hand-input/idlharness.https.window.js: Copied from LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/idlharness.https.window.js. >+ (async idl_array): >+ * web-platform-tests/webxr/hand-input/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/w3c-import.log. >+ * web-platform-tests/webxr/hit-test/META.yml: Added. >+ * web-platform-tests/webxr/hit-test/ar_hittest_source_cancel.https.html: Added. >+ * web-platform-tests/webxr/hit-test/ar_hittest_subscription_inputSources.https.html: >+ * web-platform-tests/webxr/hit-test/ar_hittest_subscription_refSpaces.https.html: >+ * web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_regular.https.html: >+ * web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_transient.https.html: >+ * web-platform-tests/webxr/hit-test/ar_hittest_subscription_transientInputSources.https.html: >+ * web-platform-tests/webxr/hit-test/w3c-import.log: >+ * web-platform-tests/webxr/layers/META.yml: Added. >+ * web-platform-tests/webxr/layers/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/w3c-import.log. >+ * web-platform-tests/webxr/layers/xrWebGLBinding_constructor.https.html: Added. >+ * web-platform-tests/webxr/light-estimation/w3c-import.log: Added. >+ * web-platform-tests/webxr/light-estimation/xrFrame_getLightEstimate_oldSession.https.html: Added. >+ * web-platform-tests/webxr/light-estimation/xrFrame_getLightEstimate_staleFrame.https.html: Added. >+ * web-platform-tests/webxr/light-estimation/xrFrame_getLightEstimate_valid.https.html: Added. >+ * web-platform-tests/webxr/light-estimation/xrSession_getLightProbe_ended.https.html: Added. >+ * web-platform-tests/webxr/light-estimation/xrSession_getLightProbe_notEnabled.https.html: Added. >+ * web-platform-tests/webxr/light-estimation/xrSession_getLightProbe_valid.https.html: Added. >+ * web-platform-tests/webxr/light-estimation/xrWebGLBinding_getReflectionCubeMap.https.html: Added. >+ * web-platform-tests/webxr/navigator_xr_sameObject.https-expected.txt: >+ * web-platform-tests/webxr/navigator_xr_sameObject.https.html: >+ * web-platform-tests/webxr/render_state_update.https-expected.txt: >+ * web-platform-tests/webxr/render_state_update.https.html: >+ * web-platform-tests/webxr/render_state_vertical_fov_immersive.https-expected.txt: >+ * web-platform-tests/webxr/render_state_vertical_fov_immersive.https.html: >+ * web-platform-tests/webxr/render_state_vertical_fov_inline.https.html: >+ * web-platform-tests/webxr/resources/w3c-import.log: >+ * web-platform-tests/webxr/resources/webxr_math_utils.js: >+ (let.flip_quaternion): >+ * web-platform-tests/webxr/resources/webxr_test_asserts.js: >+ (const.get_mismatched_component): >+ (const.assert_point_approx_equals): >+ (const.assert_orientation_approx_equals): >+ (const.assert_point_significantly_not_equals): >+ (const.assert_transform_approx_equals): >+ * web-platform-tests/webxr/resources/webxr_test_constants.js: >+ * web-platform-tests/webxr/resources/webxr_test_constants_fake_depth.js: Added. >+ (const.convertDepthBufferToArrayBuffer): >+ (const.createDepthSensingData): >+ (const.getExpectedValueAt): >+ * web-platform-tests/webxr/resources/webxr_util.js: >+ (async return): >+ (async loadChromiumResources): >+ * web-platform-tests/webxr/w3c-import.log: >+ * web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https-expected.txt: >+ * web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https.html: >+ * web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https-expected.txt: >+ * web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https.html: >+ * web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https-expected.txt: >+ * web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html: >+ * web-platform-tests/webxr/webxr_feature_policy.https.html: >+ * web-platform-tests/webxr/xrBoundedReferenceSpace_updates.https-expected.txt: >+ * web-platform-tests/webxr/xrBoundedReferenceSpace_updates.https.html: >+ * web-platform-tests/webxr/xrDevice_disconnect_ends.https.html: >+ * web-platform-tests/webxr/xrDevice_requestSession_immersive.https-expected.txt: >+ * web-platform-tests/webxr/xrDevice_requestSession_immersive.https.html: >+ * web-platform-tests/webxr/xrDevice_requestSession_optionalFeatures.https-expected.txt: >+ * web-platform-tests/webxr/xrDevice_requestSession_optionalFeatures.https.html: >+ * web-platform-tests/webxr/xrDevice_requestSession_requiredFeatures_unknown.https-expected.txt: >+ * web-platform-tests/webxr/xrFrame_getPose.https-expected.txt: >+ * web-platform-tests/webxr/xrFrame_getPose.https.html: >+ * web-platform-tests/webxr/xrFrame_getViewerPose_getPose.https-expected.txt: >+ * web-platform-tests/webxr/xrFrame_getViewerPose_getPose.https.html: >+ * web-platform-tests/webxr/xrFrame_getViewerPose_getPose_identities.https.html: Added. >+ * web-platform-tests/webxr/xrFrame_lifetime.https.html: >+ * web-platform-tests/webxr/xrFrame_session_sameObject.https-expected.txt: >+ * web-platform-tests/webxr/xrFrame_session_sameObject.https.html: >+ * web-platform-tests/webxr/xrInputSource_add_remove.https-expected.txt: >+ * web-platform-tests/webxr/xrInputSource_add_remove.https.html: >+ * web-platform-tests/webxr/xrInputSource_emulatedPosition.https-expected.txt: >+ * web-platform-tests/webxr/xrInputSource_emulatedPosition.https.html: >+ * web-platform-tests/webxr/xrInputSource_profiles.https-expected.txt: >+ * web-platform-tests/webxr/xrInputSource_profiles.https.html: >+ * web-platform-tests/webxr/xrInputSource_sameObject.https-expected.txt: >+ * web-platform-tests/webxr/xrInputSource_sameObject.https.html: >+ * web-platform-tests/webxr/xrPose_transform_sameObject.https.html: >+ * web-platform-tests/webxr/xrReferenceSpace_originOffset.https-expected.txt: >+ * web-platform-tests/webxr/xrReferenceSpace_originOffset.https.html: >+ * web-platform-tests/webxr/xrReferenceSpace_originOffsetBounded.https.html: >+ * web-platform-tests/webxr/xrReferenceSpace_originOffset_viewer.https-expected.txt: >+ * web-platform-tests/webxr/xrReferenceSpace_originOffset_viewer.https.html: >+ * web-platform-tests/webxr/xrReferenceSpace_relationships.https-expected.txt: >+ * web-platform-tests/webxr/xrReferenceSpace_relationships.https.html: >+ * web-platform-tests/webxr/xrRigidTransform_constructor.https-expected.txt: >+ * web-platform-tests/webxr/xrRigidTransform_constructor.https.html: >+ * web-platform-tests/webxr/xrRigidTransform_inverse.https-expected.txt: >+ * web-platform-tests/webxr/xrRigidTransform_inverse.https.html: >+ * web-platform-tests/webxr/xrRigidTransform_sameObject.https-expected.txt: >+ * web-platform-tests/webxr/xrRigidTransform_sameObject.https.html: >+ * web-platform-tests/webxr/xrSession_cancelAnimationFrame.https-expected.txt: >+ * web-platform-tests/webxr/xrSession_cancelAnimationFrame.https.html: >+ * web-platform-tests/webxr/xrSession_cancelAnimationFrame_invalidhandle.https-expected.txt: >+ * web-platform-tests/webxr/xrSession_cancelAnimationFrame_invalidhandle.https.html: >+ * web-platform-tests/webxr/xrSession_end.https-expected.txt: >+ * web-platform-tests/webxr/xrSession_end.https.html: >+ * web-platform-tests/webxr/xrSession_input_events_end.https.html: >+ * web-platform-tests/webxr/xrSession_requestAnimationFrame_callback_calls.https-expected.txt: >+ * web-platform-tests/webxr/xrSession_requestAnimationFrame_callback_calls.https.html: >+ * web-platform-tests/webxr/xrSession_requestAnimationFrame_data_valid.https-expected.txt: >+ * web-platform-tests/webxr/xrSession_requestAnimationFrame_data_valid.https.html: >+ * web-platform-tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https-expected.txt: >+ * web-platform-tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https.html: >+ * web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https-expected.txt: >+ * web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https.html: >+ * web-platform-tests/webxr/xrSession_requestReferenceSpace.https-expected.txt: >+ * web-platform-tests/webxr/xrSession_requestReferenceSpace.https.html: >+ * web-platform-tests/webxr/xrSession_requestReferenceSpace_features.https-expected.txt: >+ * web-platform-tests/webxr/xrSession_requestReferenceSpace_features.https.html: >+ * web-platform-tests/webxr/xrSession_requestSessionDuringEnd.https.html: Added. >+ * web-platform-tests/webxr/xrSession_sameObject.https-expected.txt: >+ * web-platform-tests/webxr/xrSession_sameObject.https.html: >+ * web-platform-tests/webxr/xrSession_viewer_referenceSpace.https-expected.txt: >+ * web-platform-tests/webxr/xrSession_viewer_referenceSpace.https.html: >+ * web-platform-tests/webxr/xrSession_visibilityState.https.html: >+ * web-platform-tests/webxr/xrStationaryReferenceSpace_floorlevel_updates.https.html: >+ * web-platform-tests/webxr/xrView_eyes.https-expected.txt: >+ * web-platform-tests/webxr/xrView_eyes.https.html: >+ * web-platform-tests/webxr/xrView_match.https-expected.txt: >+ * web-platform-tests/webxr/xrView_match.https.html: >+ * web-platform-tests/webxr/xrView_oneframeupdate.https-expected.txt: >+ * web-platform-tests/webxr/xrView_oneframeupdate.https.html: >+ * web-platform-tests/webxr/xrView_sameObject.https-expected.txt: >+ * web-platform-tests/webxr/xrView_sameObject.https.html: >+ * web-platform-tests/webxr/xrViewerPose_views_sameObject.https-expected.txt: >+ * web-platform-tests/webxr/xrViewerPose_views_sameObject.https.html: >+ * web-platform-tests/webxr/xrViewport_valid.https-expected.txt: >+ * web-platform-tests/webxr/xrViewport_valid.https.html: >+ * web-platform-tests/webxr/xrWebGLLayer_constructor.https-expected.txt: >+ * web-platform-tests/webxr/xrWebGLLayer_constructor.https.html: >+ * web-platform-tests/webxr/xrWebGLLayer_framebuffer_draw.https-expected.txt: >+ * web-platform-tests/webxr/xrWebGLLayer_framebuffer_draw.https.html: >+ * web-platform-tests/webxr/xrWebGLLayer_framebuffer_sameObject.https-expected.txt: >+ * web-platform-tests/webxr/xrWebGLLayer_framebuffer_sameObject.https.html: >+ * web-platform-tests/webxr/xrWebGLLayer_framebuffer_scale.https.html: >+ * web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer.https-expected.txt: >+ * web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer.https.html: >+ * web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer_stencil.https.html: >+ * web-platform-tests/webxr/xrWebGLLayer_viewports.https-expected.txt: >+ * web-platform-tests/webxr/xrWebGLLayer_viewports.https.html: >+ * web-platform-tests/webxr/xr_viewport_scale.https.html: Added. >+ > 2021-05-21 Rob Buis <rbuis@igalia.com> > > grid track size should reject unitless length >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/META.yml b/LayoutTests/imported/w3c/web-platform-tests/webxr/META.yml >index 520afec2000721d04aae9ed89bca49297fa31d4b..13c5d7b595c62394e4593bd0dca142bcd7a21068 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/META.yml >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/META.yml >@@ -1,3 +1,3 @@ >-spec: https://immersive-web.github.io/webxr/spec/latest/ >+spec: https://immersive-web.github.io/webxr/ > suggested_reviewers: > - klausw >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/META.yml b/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/META.yml >new file mode 100644 >index 0000000000000000000000000000000000000000..0b7f740ac531002086e79b7f57647c62fd5db220 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/META.yml >@@ -0,0 +1 @@ >+spec: https://immersive-web.github.io/anchors/ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_create_move.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_create_move.https.html >index af1898cac2eba38a8b769621708cbc95772c8a2b..87f7556007d42f65cf710970ab3f31a9f23f2fe6 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_create_move.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_create_move.https.html >@@ -5,7 +5,6 @@ > <script src="../resources/webxr_test_asserts.js"></script> > <script src="../resources/webxr_test_constants.js"></script> > <script src="../resources/webxr_test_constants_fake_world.js"></script> >-<canvas /> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_delay_creation.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_delay_creation.https.html >index a2f438781813e963e829f224a4f79ee6aeb0d46f..686eacf8487a0002f03213770ee52680514cf59c 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_delay_creation.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_delay_creation.https.html >@@ -5,7 +5,6 @@ > <script src="../resources/webxr_test_asserts.js"></script> > <script src="../resources/webxr_test_constants.js"></script> > <script src="../resources/webxr_test_constants_fake_world.js"></script> >-<canvas /> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_failure.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_failure.https.html >index 1625538d7542965f07a19eb534fdb31b1fb49082..dd03be0ad5bfd2198428ec150be44016f8917ad0 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_failure.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_failure.https.html >@@ -5,7 +5,6 @@ > <script src="../resources/webxr_test_asserts.js"></script> > <script src="../resources/webxr_test_constants.js"></script> > <script src="../resources/webxr_test_constants_fake_world.js"></script> >-<canvas /> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_pause_resume_stop.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_pause_resume_stop.https.html >index d3cc4c72dd2e88016abe7afabe3e5abd12b91019..6eb6bc76e64c963ab1512998c9262489f528d4f2 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_pause_resume_stop.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_pause_resume_stop.https.html >@@ -5,7 +5,6 @@ > <script src="../resources/webxr_test_asserts.js"></script> > <script src="../resources/webxr_test_constants.js"></script> > <script src="../resources/webxr_test_constants_fake_world.js"></script> >-<canvas /> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_states.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_states.https.html >index 1872cf527b8b5ec1f25d044b8021f5b75ea9e4a6..83695498529a57caa98cc019f146b0f7df58da55 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_states.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_states.https.html >@@ -5,7 +5,6 @@ > <script src="../resources/webxr_test_asserts.js"></script> > <script src="../resources/webxr_test_constants.js"></script> > <script src="../resources/webxr_test_constants_fake_world.js"></script> >-<canvas /> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/w3c-import.log >index f3c493b73d70d81b681096227fcd1c7bd05d85d3..aa24e70b35fb7317a4dbcb74aea04c31f271cf71 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/w3c-import.log >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/w3c-import.log >@@ -14,6 +14,7 @@ Property values requiring vendor prefixes: > None > ------------------------------------------------------------------------ > List of files: >+/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/META.yml > /LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_create_move.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_delay_creation.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_failure.https.html >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/META.yml b/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/META.yml >new file mode 100644 >index 0000000000000000000000000000000000000000..47e5ea9cd4cd595de3b799f034977f3e336aa565 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/META.yml >@@ -0,0 +1 @@ >+spec: https://immersive-web.github.io/webxr-ar-module/ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/w3c-import.log >index 902be5a0f6a2598780e0cdea2c427f22c6e8bcad..e7ca3b59d2209b1cbcdbc6c65cf1909b94971584 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/w3c-import.log >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/w3c-import.log >@@ -14,7 +14,9 @@ Property values requiring vendor prefixes: > None > ------------------------------------------------------------------------ > List of files: >+/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/META.yml > /LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/idlharness.https.window.js > /LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrDevice_isSessionSupported_immersive-ar.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrDevice_requestSession_immersive-ar.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrSession_environmentBlendMode.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrSession_interactionMode.https.html >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrDevice_requestSession_immersive-ar.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrDevice_requestSession_immersive-ar.https-expected.txt >index 7e794c067796463f5d447850e2077e8c82423a3b..af7444bf6806c8ce5184160cb5e277e9bbca8197 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrDevice_requestSession_immersive-ar.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrDevice_requestSession_immersive-ar.https-expected.txt >@@ -1,4 +1,5 @@ > >-PASS Tests requestSession accepts immersive-ar mode >+PASS Tests requestSession accepts immersive-ar mode - webgl >+FAIL Tests requestSession accepts immersive-ar mode - webgl2 assert_implements: webgl2 not supported. undefined > PASS Tests requestSession rejects immersive-ar mode when unsupported > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrDevice_requestSession_immersive-ar.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrDevice_requestSession_immersive-ar.https.html >index 1be56dd60ec81de8595bfca7e1fd39e6e9554b31..9984ee589d77c03496e3ba8cfe03d124d7a12ffc 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrDevice_requestSession_immersive-ar.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrDevice_requestSession_immersive-ar.https.html >@@ -4,7 +4,6 @@ > <script src=/resources/testharnessreport.js></script> > <script src="../resources/webxr_util.js"></script> > <script src="../resources/webxr_test_constants.js"></script> >- <canvas></canvas> > <script> > xr_session_promise_test( > "Tests requestSession accepts immersive-ar mode", >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrSession_environmentBlendMode.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrSession_environmentBlendMode.https.html >index da2ddc28d8dc8c4903b985dbe08f9ad034ef0f1b..beff66586c7119d15fdc6c6960d67b0023fdab53 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrSession_environmentBlendMode.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrSession_environmentBlendMode.https.html >@@ -4,7 +4,6 @@ > <script src=/resources/testharnessreport.js></script> > <script src="../resources/webxr_util.js"></script> > <script src="../resources/webxr_test_constants.js"></script> >- <canvas></canvas> > <script> > xr_session_promise_test( > "Tests environmentBlendMode for an AR device", >@@ -21,4 +20,4 @@ > assert_in_array(session.environmentBlendMode, ["opaque", "additive"]); > }, TRACKED_IMMERSIVE_DEVICE, 'immersive-vr', {}); > </script> >-</body> >+</body> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrSession_interactionMode.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrSession_interactionMode.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..89cdc80132fb3dd4eb90fa477e280edc132912db >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/xrSession_interactionMode.https.html >@@ -0,0 +1,84 @@ >+<!DOCTYPE html> >+<body> >+ <script src=/resources/testharness.js></script> >+ <script src=/resources/testharnessreport.js></script> >+ <script src="../resources/webxr_util.js"></script> >+ <script src="../resources/webxr_test_constants.js"></script> >+ <canvas></canvas> >+ <script> >+ const VR_HMD_DEVICE = { >+ supportsImmersive: true, >+ supportedModes: [ "immersive-vr"], >+ views: VALID_VIEWS, >+ viewerOrigin: IDENTITY_TRANSFORM, >+ supportedFeatures: ALL_FEATURES, >+ environmentBlendMode: "opaque", >+ interactionMode: "world-space" >+ }; >+ xr_session_promise_test( >+ "Tests interactionMode for an VR_HMD_DEVICE", >+ (session) => { >+ assert_equals(session.interactionMode, "world-space"); >+ }, VR_HMD_DEVICE, 'immersive-vr', {}); >+ >+ const VR_SCREEN_DEVICE = { >+ supportsImmersive: true, >+ supportedModes: [ "immersive-vr"], >+ views: VALID_VIEWS, >+ viewerOrigin: IDENTITY_TRANSFORM, >+ supportedFeatures: ALL_FEATURES, >+ environmentBlendMode: "opaque", >+ interactionMode: "screen-space" >+ }; >+ xr_session_promise_test( >+ "Tests interactionMode for an VR_SCREEN_DEVICE", >+ (session) => { >+ assert_equals(session.interactionMode, "screen-space"); >+ }, VR_SCREEN_DEVICE, 'immersive-vr', {}); >+ >+ const AR_HMD_DEVICE = { >+ supportsImmersive: true, >+ supportedModes: [ "immersive-ar"], >+ views: VALID_VIEWS, >+ viewerOrigin: IDENTITY_TRANSFORM, >+ supportedFeatures: ALL_FEATURES, >+ environmentBlendMode: "additive", >+ interactionMode: "world-space" >+ }; >+ xr_session_promise_test( >+ "Tests interactionMode for an AR_HMD_DEVICE", >+ (session) => { >+ assert_equals(session.interactionMode, "world-space"); >+ }, AR_HMD_DEVICE, 'immersive-ar', {}); >+ >+ const AR_SCREEN_DEVICE = { >+ supportsImmersive: true, >+ supportedModes: [ "immersive-ar"], >+ views: VALID_VIEWS, >+ viewerOrigin: IDENTITY_TRANSFORM, >+ supportedFeatures: ALL_FEATURES, >+ environmentBlendMode: "opaque", >+ interactionMode: "screen-space" >+ }; >+ xr_session_promise_test( >+ "Tests interactionMode for an AR_SCREEN_DEVICE", >+ (session) => { >+ assert_equals(session.interactionMode, "screen-space"); >+ }, AR_SCREEN_DEVICE, 'immersive-ar', {}); >+ >+ const INLINE_SCREEN_DEVICE = { >+ supportsImmersive: true, >+ supportedModes: [ "inline"], >+ views: VALID_VIEWS, >+ viewerOrigin: IDENTITY_TRANSFORM, >+ supportedFeatures: ALL_FEATURES, >+ environmentBlendMode: "opaque", >+ interactionMode: "screen-space" >+ }; >+ xr_session_promise_test( >+ "Tests interactionMode for a INLINE_SCREEN_DEVICE", >+ (session) => { >+ assert_equals(session.interactionMode, "screen-space"); >+ }, INLINE_SCREEN_DEVICE, 'inline', {}); >+</script> >+</body> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_dataUnavailable.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_dataUnavailable.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..e120f0b7dd161a01059ebf9bb773cbb706721d48 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_dataUnavailable.https.html >@@ -0,0 +1,27 @@ >+<!DOCTYPE html> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="../../resources/webxr_util.js"></script> >+<script src="../../resources/webxr_test_asserts.js"></script> >+<script src="../../resources/webxr_test_constants.js"></script> >+<script src="../../resources/webxr_test_constants_fake_depth.js"></script> >+<script src="../dataUnavailableTests.js"></script> >+ >+<script> >+ >+const fakeDeviceInitParams = { >+ supportedModes: ["immersive-ar"], >+ views: VALID_VIEWS, >+ supportedFeatures: ALL_FEATURES, >+ depthSensingData: DEPTH_SENSING_DATA, >+}; >+ >+xr_session_promise_test("Ensures depth data is not available when cleared in the controller, `cpu-optimized`", >+ dataUnavailableTestFunctionGenerator(/*isCpuOptimized=*/true), >+ fakeDeviceInitParams, >+ 'immersive-ar', { >+ requiredFeatures: ['depth-sensing'], >+ depthSensing: VALID_DEPTH_CONFIG_CPU_USAGE, >+ }); >+ >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_inactiveFrame.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_inactiveFrame.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..92c20cecbf677900a474f0fd6694bf3c024ce4b1 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_inactiveFrame.https.html >@@ -0,0 +1,26 @@ >+<!DOCTYPE html> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="../../resources/webxr_util.js"></script> >+<script src="../../resources/webxr_test_asserts.js"></script> >+<script src="../../resources/webxr_test_constants.js"></script> >+<script src="../../resources/webxr_test_constants_fake_depth.js"></script> >+<script src="../inactiveFrameTests.js"></script> >+ >+<script> >+ >+const fakeDeviceInitParams = { >+ supportedModes: ["immersive-ar"], >+ views: VALID_VIEWS, >+ supportedFeatures: ALL_FEATURES, >+}; >+ >+xr_session_promise_test("Ensures getDepthInformation() throws when not run in an active frame, `cpu-optimized`", >+ inactiveFrameTestFunctionGenerator(/*isCpuOptimized=*/true), >+ fakeDeviceInitParams, >+ 'immersive-ar', { >+ requiredFeatures: ['depth-sensing'], >+ depthSensing: VALID_DEPTH_CONFIG_CPU_USAGE, >+ }); >+ >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_incorrectUsage.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_incorrectUsage.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..44868d8cb0e0322efcda6bd7a935e523d8959f6c >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_incorrectUsage.https.html >@@ -0,0 +1,48 @@ >+<!DOCTYPE html> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="../../resources/webxr_util.js"></script> >+<script src="../../resources/webxr_test_asserts.js"></script> >+<script src="../../resources/webxr_test_constants.js"></script> >+<script src="../../resources/webxr_test_constants_fake_depth.js"></script> >+<script src="../incorrectUsageTests.js"></script> >+ >+<script> >+ >+const fakeDeviceInitParams = { >+ supportedModes: ["immersive-ar"], >+ views: VALID_VIEWS, >+ supportedFeatures: ALL_FEATURES, >+}; >+ >+const incorrectUsagetestFunctionTryGetWebGLOnCpu = function (session, controller, t, sessionObjects) { >+ return session.requestReferenceSpace('viewer').then((viewerSpace) => { >+ let done = false; >+ >+ const glBinding = new XRWebGLBinding(session, sessionObjects.gl); >+ >+ session.requestAnimationFrame((time, frame) => { >+ const pose = frame.getViewerPose(viewerSpace); >+ for(const view of pose.views) { >+ t.step(() => { >+ assert_throws_dom("InvalidStateError", () => glBinding.getDepthInformation(view), >+ "XRWebGLBinding.getDepthInformation() should throw when depth sensing is in `cpu-optimized` usage mode"); >+ }); >+ } >+ >+ done = true; >+ }); >+ >+ return t.step_wait(() => done); >+ }); >+}; >+ >+xr_session_promise_test("Ensures XRWebGLDepthInformation is not obtainable in `cpu-optimized` usage mode", >+ incorrectUsagetestFunctionTryGetWebGLOnCpu, >+ fakeDeviceInitParams, >+ 'immersive-ar', { >+ requiredFeatures: ['depth-sensing'], >+ depthSensing: VALID_DEPTH_CONFIG_CPU_USAGE, >+ }); >+ >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_luminance_alpha_dataValid.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_luminance_alpha_dataValid.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..db88c42558f5af5704603ad119f694ae063c2809 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_luminance_alpha_dataValid.https.html >@@ -0,0 +1,110 @@ >+<!DOCTYPE html> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="../../resources/webxr_util.js"></script> >+<script src="../../resources/webxr_math_utils.js"></script> >+<script src="../../resources/webxr_test_asserts.js"></script> >+<script src="../../resources/webxr_test_constants.js"></script> >+<script src="../../resources/webxr_test_constants_fake_depth.js"></script> >+ >+<script> >+ >+const fakeDeviceInitParams = { >+ supportedModes: ["immersive-ar"], >+ views: VALID_VIEWS, >+ supportedFeatures: ALL_FEATURES, >+ depthSensingData: DEPTH_SENSING_DATA, >+}; >+ >+const assert_depth_valid_at = function(depthInformation, row, column, deltaRow, deltaColumn) { >+ // column and row correspond to the depth buffer coordinates, >+ // *not* to normalized view coordinates the getDepthInMeters() expects. >+ >+ const expectedValue = getExpectedValueAt(column, row); >+ >+ // 1. Normalize: >+ let x = (column + deltaColumn) / depthInformation.width; >+ let y = (row + deltaRow) / depthInformation.height; >+ >+ // 2. Apply the transform that changes the origin and axes: >+ x = 1.0 - x; >+ y = 1.0 - y; >+ >+ const depthValue = depthInformation.getDepthInMeters(x, y); >+ assert_approx_equals(depthValue, expectedValue, FLOAT_EPSILON, >+ "Depth value at (" + column + "," + row + "), deltas=(" + deltaColumn + ", " + deltaRow + "), " >+ + "coordinates (" + x + "," + y + ") must match!"); >+} >+ >+const assert_depth_valid = function(depthInformation) { >+ >+ assert_true(depthInformation.data instanceof ArrayBuffer, >+ "XRCpuDepthInformation.data must be of type `ArrayBuffer`!"); >+ >+ for(let row = 0; row < depthInformation.height; row++) { >+ for(let column = 0; column < depthInformation.width; column++) { >+ // middle of the pixel: >+ assert_depth_valid_at(depthInformation, row, column, 0.5, 0.5); >+ >+ // corners of the pixel: >+ assert_depth_valid_at(depthInformation, row, column, FLOAT_EPSILON, FLOAT_EPSILON); >+ assert_depth_valid_at(depthInformation, row, column, FLOAT_EPSILON, 1 - FLOAT_EPSILON); >+ assert_depth_valid_at(depthInformation, row, column, 1 - FLOAT_EPSILON, FLOAT_EPSILON); >+ assert_depth_valid_at(depthInformation, row, column, 1 - FLOAT_EPSILON, 1 - FLOAT_EPSILON); >+ } >+ } >+ >+ // Verify out-of-bounds accesses throw: >+ assert_throws_js(RangeError, >+ () => depthInformation.getDepthInMeters(-FLOAT_EPSILON, 0.0), >+ "getDepthInMeters() should throw when run with invalid indices - negative x"); >+ assert_throws_js(RangeError, >+ () => depthInformation.getDepthInMeters(0.0, -FLOAT_EPSILON), >+ "getDepthInMeters() should throw when run with invalid indices - negative y"); >+ assert_throws_js(RangeError, >+ () => depthInformation.getDepthInMeters(1+FLOAT_EPSILON, 0.0), >+ "getDepthInMeters() should throw when run with invalid indices - too big x"); >+ assert_throws_js(RangeError, >+ () => depthInformation.getDepthInMeters(0.0, 1+FLOAT_EPSILON), >+ "getDepthInMeters() should throw when run with invalid indices - too big y"); >+}; >+ >+const testCpuOptimizedLuminanceAlpha = function(session, fakeDeviceController, t) { >+ return session.requestReferenceSpace('viewer').then((viewerSpace) => { >+ let done = false; >+ >+ const rafCallback = function(time, frame) { >+ const pose = frame.getViewerPose(viewerSpace); >+ if(pose) { >+ for(const view of pose.views) { >+ const depthInformation = frame.getDepthInformation(view); >+ >+ t.step(() => { >+ assert_not_equals(depthInformation, null, "XRCPUDepthInformation must not be null!"); >+ assert_approx_equals(depthInformation.width, DEPTH_SENSING_DATA.width, FLOAT_EPSILON); >+ assert_approx_equals(depthInformation.height, DEPTH_SENSING_DATA.height, FLOAT_EPSILON); >+ assert_approx_equals(depthInformation.rawValueToMeters, DEPTH_SENSING_DATA.rawValueToMeters, FLOAT_EPSILON); >+ assert_transform_approx_equals(depthInformation.normDepthBufferFromNormView, DEPTH_SENSING_DATA.normDepthBufferFromNormView); >+ assert_depth_valid(depthInformation); >+ }); >+ } >+ } >+ >+ done = true; >+ }; >+ >+ session.requestAnimationFrame(rafCallback); >+ >+ return t.step_wait(() => done); >+ }); >+}; >+ >+xr_session_promise_test("Ensures depth data is returned and values match expectation, cpu-optimized, luminance-alpha.", >+ testCpuOptimizedLuminanceAlpha, >+ fakeDeviceInitParams, >+ 'immersive-ar', { >+ 'requiredFeatures': ['depth-sensing'], >+ depthSensing: VALID_DEPTH_CONFIG_CPU_USAGE, >+ }); >+ >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_staleView.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_staleView.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..6a411ace451f817ba20c69a3eca22b55c536a56a >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_staleView.https.html >@@ -0,0 +1,26 @@ >+<!DOCTYPE html> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="../../resources/webxr_util.js"></script> >+<script src="../../resources/webxr_test_asserts.js"></script> >+<script src="../../resources/webxr_test_constants.js"></script> >+<script src="../../resources/webxr_test_constants_fake_depth.js"></script> >+<script src="../staleViewsTests.js"></script> >+ >+<script> >+ >+const fakeDeviceInitParams = { >+ supportedModes: ["immersive-ar"], >+ views: VALID_VIEWS, >+ supportedFeatures: ALL_FEATURES, >+}; >+ >+xr_session_promise_test("Ensures getDepthInformation() throws when run with stale XRView, `cpu-optimized`", >+ staleViewsTestFunctionGenerator(/*isCpuOptimized=*/true), >+ fakeDeviceInitParams, >+ 'immersive-ar', { >+ requiredFeatures: ['depth-sensing'], >+ depthSensing: VALID_DEPTH_CONFIG_CPU_USAGE, >+ }); >+ >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/w3c-import.log >new file mode 100644 >index 0000000000000000000000000000000000000000..c30704d565b1d252fedf10d78638de9cfe235d0d >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/w3c-import.log >@@ -0,0 +1,21 @@ >+The tests in this directory were imported from the W3C repository. >+Do NOT modify these tests directly in WebKit. >+Instead, create a pull request on the WPT github: >+ https://github.com/web-platform-tests/wpt >+ >+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport >+ >+Do NOT modify or remove this file. >+ >+------------------------------------------------------------------------ >+Properties requiring vendor prefixes: >+None >+Property values requiring vendor prefixes: >+None >+------------------------------------------------------------------------ >+List of files: >+/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_dataUnavailable.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_inactiveFrame.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_incorrectUsage.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_luminance_alpha_dataValid.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/cpu/depth_sensing_cpu_staleView.https.html >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/dataUnavailableTests.js b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/dataUnavailableTests.js >new file mode 100644 >index 0000000000000000000000000000000000000000..7460af71326291923e7a5406ea4773be0953137f >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/dataUnavailableTests.js >@@ -0,0 +1,58 @@ >+'use strict'; >+ >+const TestStates = Object.freeze({ >+ "ShouldSucceedScheduleRAF": 1, >+ "ShouldFailScheduleRAF": 2, >+ "ShouldSucceedTestDone": 3, >+}); >+ >+const dataUnavailableTestFunctionGenerator = function(isCpuOptimized) { >+ return (session, controller, t, sessionObjects) => { >+ let state = TestStates.ShouldSucceedScheduleRAF; >+ >+ return session.requestReferenceSpace('viewer').then((viewerSpace) => { >+ let done = false; >+ >+ const glBinding = new XRWebGLBinding(session, sessionObjects.gl); >+ >+ const rafCb = function(time, frame) { >+ const pose = frame.getViewerPose(viewerSpace); >+ for(const view of pose.views) { >+ const depthInformation = isCpuOptimized ? frame.getDepthInformation(view) >+ : glBinding.getDepthInformation(view); >+ >+ if (state == TestStates.ShouldSucceedScheduleRAF >+ || state == TestStates.ShouldSucceedTestDone) { >+ t.step(() => { >+ assert_not_equals(depthInformation, null); >+ }); >+ } else { >+ t.step(() => { >+ assert_equals(depthInformation, null); >+ }); >+ } >+ } >+ >+ switch(state) { >+ case TestStates.ShouldSucceedScheduleRAF: >+ controller.clearDepthSensingData(); >+ state = TestStates.ShouldFailScheduleRAF; >+ session.requestAnimationFrame(rafCb); >+ break; >+ case TestStates.ShouldFailScheduleRAF: >+ controller.setDepthSensingData(DEPTH_SENSING_DATA); >+ state = TestStates.ShouldSucceedTestDone; >+ session.requestAnimationFrame(rafCb); >+ break; >+ case TestStates.ShouldSucceedTestDone: >+ done = true; >+ break; >+ } >+ }; >+ >+ session.requestAnimationFrame(rafCb); >+ >+ return t.step_wait(() => done); >+ }); >+ }; >+}; >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/depth_sensing_notEnabled.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/depth_sensing_notEnabled.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..23bae35493a651a6a2bd9c424d020825bdf12dcf >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/depth_sensing_notEnabled.https.html >@@ -0,0 +1,61 @@ >+<!DOCTYPE html> >+<script src=/resources/testharness.js></script> >+<script src=/resources/testharnessreport.js></script> >+<script src="../resources/webxr_util.js"></script> >+<script src="../resources/webxr_test_constants.js"></script> >+ >+<script> >+ >+const testFunctionCpu = function (session, controller, t) { >+ return session.requestReferenceSpace('viewer').then((viewerSpace) => { >+ let done = false; >+ >+ session.requestAnimationFrame((time, frame) => { >+ const pose = frame.getViewerPose(viewerSpace); >+ for(const view of pose.views) { >+ assert_throws_dom("NotSupportedError", () => frame.getDepthInformation(view), >+ "getDepthInformation() should throw when depth sensing is disabled"); >+ } >+ >+ done = true; >+ }); >+ >+ return t.step_wait(() => done); >+ }); >+}; >+ >+const testFunctionGpu = function (session, controller, t, sessionObjects) { >+ return session.requestReferenceSpace('viewer').then((viewerSpace) => { >+ let done = false; >+ >+ const glBinding = new XRWebGLBinding(session, sessionObjects.gl); >+ >+ session.requestAnimationFrame((time, frame) => { >+ const pose = frame.getViewerPose(viewerSpace); >+ for(const view of pose.views) { >+ t.step(() => { >+ assert_throws_dom("NotSupportedError", () => glBinding.getDepthInformation(view), >+ "getDepthInformation() should throw when depth sensing is disabled"); >+ }); >+ } >+ >+ done = true; >+ }); >+ >+ return t.step_wait(() => done); >+ }); >+}; >+ >+xr_session_promise_test( >+ "XRFrame.getDepthInformation() rejects if depth sensing is not enabled on a session", >+ testFunctionCpu, >+ IMMERSIVE_AR_DEVICE, >+ 'immersive-ar'); >+ >+xr_session_promise_test( >+ "XRWebGLBinding.getDepthInformation() rejects if depth sensing is not enabled on a session", >+ testFunctionGpu, >+ IMMERSIVE_AR_DEVICE, >+ 'immersive-ar'); >+ >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_dataUnavailable.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_dataUnavailable.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..018edf7693452d69753758dc0db8e25a36d8615c >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_dataUnavailable.https.html >@@ -0,0 +1,27 @@ >+<!DOCTYPE html> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="../../resources/webxr_util.js"></script> >+<script src="../../resources/webxr_test_asserts.js"></script> >+<script src="../../resources/webxr_test_constants.js"></script> >+<script src="../../resources/webxr_test_constants_fake_depth.js"></script> >+<script src="../dataUnavailableTests.js"></script> >+ >+<script> >+ >+const fakeDeviceInitParams = { >+ supportedModes: ["immersive-ar"], >+ views: VALID_VIEWS, >+ supportedFeatures: ALL_FEATURES, >+ depthSensingData: DEPTH_SENSING_DATA, >+}; >+ >+xr_session_promise_test("Ensures depth data is not available when cleared in the controller, `gpu-optimized`", >+ dataUnavailableTestFunctionGenerator(/*isCpuOptimized=*/false), >+ fakeDeviceInitParams, >+ 'immersive-ar', { >+ requiredFeatures: ['depth-sensing'], >+ depthSensing: VALID_DEPTH_CONFIG_GPU_USAGE, >+ }); >+ >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_inactiveFrame.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_inactiveFrame.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..6116f7a0414e578e88ada99508d67f8318578b8d >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_inactiveFrame.https.html >@@ -0,0 +1,26 @@ >+<!DOCTYPE html> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="../../resources/webxr_util.js"></script> >+<script src="../../resources/webxr_test_asserts.js"></script> >+<script src="../../resources/webxr_test_constants.js"></script> >+<script src="../../resources/webxr_test_constants_fake_depth.js"></script> >+<script src="../inactiveFrameTests.js"></script> >+ >+<script> >+ >+const fakeDeviceInitParams = { >+ supportedModes: ["immersive-ar"], >+ views: VALID_VIEWS, >+ supportedFeatures: ALL_FEATURES, >+}; >+ >+xr_session_promise_test("Ensures getDepthInformation() throws when not run in an active frame, `gpu-optimized`", >+ testFunctionGenerator(/*isCpuOptimized=*/false), >+ fakeDeviceInitParams, >+ 'immersive-ar', { >+ requiredFeatures: ['depth-sensing'], >+ depthSensing: VALID_DEPTH_CONFIG_GPU_USAGE, >+ }); >+ >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_incorrectUsage.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_incorrectUsage.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..9fc2e6a5f83fd0bb1510492e2c1e05616170c062 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_incorrectUsage.https.html >@@ -0,0 +1,46 @@ >+<!DOCTYPE html> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="../../resources/webxr_util.js"></script> >+<script src="../../resources/webxr_test_asserts.js"></script> >+<script src="../../resources/webxr_test_constants.js"></script> >+<script src="../../resources/webxr_test_constants_fake_depth.js"></script> >+<script src="../incorrectUsageTests.js"></script> >+ >+<script> >+ >+const fakeDeviceInitParams = { >+ supportedModes: ["immersive-ar"], >+ views: VALID_VIEWS, >+ supportedFeatures: ALL_FEATURES, >+}; >+ >+const incorrectUsageTestFunctionTryGetCpuOnGpu = function (session, controller, t, sessionObjects) { >+ return session.requestReferenceSpace('viewer').then((viewerSpace) => { >+ let done = false; >+ >+ session.requestAnimationFrame((time, frame) => { >+ const pose = frame.getViewerPose(viewerSpace); >+ for(const view of pose.views) { >+ t.step(() => { >+ assert_throws_dom("InvalidStateError", () => frame.getDepthInformation(view), >+ "XRFrame.getDepthInformation() should throw when depth sensing is in `gpu-optimized` usage mode"); >+ }); >+ } >+ >+ done = true; >+ }); >+ >+ return t.step_wait(() => done); >+ }); >+}; >+ >+xr_session_promise_test("Ensures XRCPUDepthInformation is not obtainable in `gpu-optimized` usage mode", >+ incorrectUsageTestFunctionTryGetCpuOnGpu, >+ fakeDeviceInitParams, >+ 'immersive-ar', { >+ requiredFeatures: ['depth-sensing'], >+ depthSensing: VALID_DEPTH_CONFIG_GPU_USAGE, >+ }); >+ >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_staleView.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_staleView.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..ecd0d479f7aac7222d512edeafef9565993add1d >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_staleView.https.html >@@ -0,0 +1,26 @@ >+<!DOCTYPE html> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="../../resources/webxr_util.js"></script> >+<script src="../../resources/webxr_test_asserts.js"></script> >+<script src="../../resources/webxr_test_constants.js"></script> >+<script src="../../resources/webxr_test_constants_fake_depth.js"></script> >+<script src="../staleViewsTests.js"></script> >+ >+<script> >+ >+const fakeDeviceInitParams = { >+ supportedModes: ["immersive-ar"], >+ views: VALID_VIEWS, >+ supportedFeatures: ALL_FEATURES, >+}; >+ >+xr_session_promise_test("Ensures getDepthInformation() throws when not run with stale XRView, `gpu-optimized`", >+ staleViewsTestFunctionGenerator(/*isCpuOptimized=*/false), >+ fakeDeviceInitParams, >+ 'immersive-ar', { >+ requiredFeatures: ['depth-sensing'], >+ depthSensing: VALID_DEPTH_CONFIG_GPU_USAGE, >+ }); >+ >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/w3c-import.log >new file mode 100644 >index 0000000000000000000000000000000000000000..b95809da17c76b0987dac705fea85fcb13742d84 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/w3c-import.log >@@ -0,0 +1,20 @@ >+The tests in this directory were imported from the W3C repository. >+Do NOT modify these tests directly in WebKit. >+Instead, create a pull request on the WPT github: >+ https://github.com/web-platform-tests/wpt >+ >+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport >+ >+Do NOT modify or remove this file. >+ >+------------------------------------------------------------------------ >+Properties requiring vendor prefixes: >+None >+Property values requiring vendor prefixes: >+None >+------------------------------------------------------------------------ >+List of files: >+/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_dataUnavailable.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_inactiveFrame.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_incorrectUsage.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/gpu/depth_sensing_gpu_staleView.https.html >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/inactiveFrameTests.js b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/inactiveFrameTests.js >new file mode 100644 >index 0000000000000000000000000000000000000000..b310f01ef871a248bdde3da0efef6b2126f13cd0 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/inactiveFrameTests.js >@@ -0,0 +1,36 @@ >+'use strict'; >+ >+const inactiveFrameTestFunctionGenerator = function(isCpuOptimized) { >+ return (session, controller, t, sessionObjects) => { >+ return session.requestReferenceSpace('viewer').then((viewerSpace) => { >+ let callbacksKickedOff = false; >+ let callbackCounter = 0; >+ >+ const glBinding = new XRWebGLBinding(session, sessionObjects.gl); >+ >+ const rafCb = function(time, frame) { >+ const pose = frame.getViewerPose(viewerSpace); >+ for(const view of pose.views) { >+ const callback = () => { >+ t.step(() => { >+ assert_throws_dom("InvalidStateError", >+ () => isCpuOptimized ? frame.getDepthInformation(view) >+ : glBinding.getDepthInformation(view), >+ "getDepthInformation() should throw when ran outside RAF"); >+ }); >+ callbackCounter--; >+ } >+ >+ t.step_timeout(callback, 10); >+ callbackCounter++; >+ } >+ >+ callbacksKickedOff = true; >+ }; >+ >+ session.requestAnimationFrame(rafCb); >+ >+ return t.step_wait(() => callbacksKickedOff && (callbackCounter == 0)); >+ }); >+ }; >+}; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/staleViewsTests.js b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/staleViewsTests.js >new file mode 100644 >index 0000000000000000000000000000000000000000..b1f11c9651d8d85e0acbb1123c35216857dfdf5b >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/staleViewsTests.js >@@ -0,0 +1,39 @@ >+'use strict'; >+ >+const staleViewsTestFunctionGenerator = function(isCpuOptimized) { >+ return (session, controller, t, sessionObjects) => { >+ let done = false; >+ >+ const staleViews = new Set(); >+ >+ return session.requestReferenceSpace('viewer').then((viewerSpace) => { >+ const glBinding = new XRWebGLBinding(session, sessionObjects.gl); >+ >+ const secondRafCb = function(time, frame) { >+ for(const view of staleViews) { >+ t.step(() => { >+ assert_throws_dom("InvalidStateError", >+ () => isCpuOptimized ? frame.getDepthInformation(view) >+ : glBinding.getDepthInformation(view), >+ "getDepthInformation() should throw when run with stale XRView"); >+ }); >+ } >+ >+ done = true; >+ }; >+ >+ const firstRafCb = function(time, frame) { >+ const pose = frame.getViewerPose(viewerSpace); >+ for(const view of pose.views) { >+ staleViews.add(view); >+ } >+ >+ session.requestAnimationFrame(secondRafCb); >+ }; >+ >+ session.requestAnimationFrame(firstRafCb); >+ >+ return t.step_wait(() => done); >+ }); >+ }; >+}; >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/w3c-import.log >new file mode 100644 >index 0000000000000000000000000000000000000000..5c9b6ad756f47e892d73447e437e0502f7a88719 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/w3c-import.log >@@ -0,0 +1,20 @@ >+The tests in this directory were imported from the W3C repository. >+Do NOT modify these tests directly in WebKit. >+Instead, create a pull request on the WPT github: >+ https://github.com/web-platform-tests/wpt >+ >+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport >+ >+Do NOT modify or remove this file. >+ >+------------------------------------------------------------------------ >+Properties requiring vendor prefixes: >+None >+Property values requiring vendor prefixes: >+None >+------------------------------------------------------------------------ >+List of files: >+/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/dataUnavailableTests.js >+/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/depth_sensing_notEnabled.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/inactiveFrameTests.js >+/LayoutTests/imported/w3c/web-platform-tests/webxr/depth-sensing/staleViewsTests.js >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/META.yml b/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/META.yml >new file mode 100644 >index 0000000000000000000000000000000000000000..be2b6e613a1457ca3c14dc854005353636ea23af >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/META.yml >@@ -0,0 +1 @@ >+spec: https://immersive-web.github.io/dom-overlays/ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/ar_dom_overlay.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/ar_dom_overlay.https.html >index de0cb68744956558541b574fd88800d262d23e97..250adf9b246b259c4d13804e5e465e35ae98b46f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/ar_dom_overlay.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/ar_dom_overlay.https.html >@@ -39,6 +39,8 @@ const fakeDeviceInitParams = { > views: VALID_VIEWS, > viewerOrigin: IDENTITY_TRANSFORM, > supportedFeatures: ALL_FEATURES, >+ environmentBlendMode: "alpha-blend", >+ interactionMode: "screen-space" > }; > > let testBasicProperties = function(overlayElement, session, fakeDeviceController, t) { >@@ -53,7 +55,7 @@ let testBasicProperties = function(overlayElement, session, fakeDeviceController > ["screen", "floating", "head-locked"]); > > // Verify SameObject property for domOverlayState >- assert_true(session.domOverlayState === session.domOverlayState); >+ assert_equals(session.domOverlayState, session.domOverlayState); > > // The overlay element should have a transparent background. > assert_equals(window.getComputedStyle(overlayElement).backgroundColor, >@@ -69,37 +71,29 @@ let testBasicProperties = function(overlayElement, session, fakeDeviceController > }); > }; > >-let testFullscreen = function(overlayElement, session, fakeDeviceController, t) { >+let testFullscreen = async function(overlayElement, session, fakeDeviceController, t) { > // If the browser implements DOM Overlay using Fullscreen API, > // it must not be possible to change the DOM Overlay element by using > // Fullscreen API, and attempts to do so must be rejected. > // Since this is up to the UA, this test also passes if the fullscreen > // element is different from the overlay element. > >- let rafPromise = new Promise((resolve) => { >- session.requestAnimationFrame((time, xrFrame) => { >- resolve(); >- }); >- }); >- let promises = [rafPromise]; >- >- if (document.fullscreenElement == overlayElement) { >- let elem = document.getElementById('div_other'); >- assert_true(elem != null); >- assert_not_equals(elem, overlayElement); >- >- let fullscreenPromise = new Promise((resolve, reject) => { >- elem.requestFullscreen().then(() => { >- assert_unreached("fullscreen change should be blocked"); >- reject(); >- }).catch(() => { >- resolve(); >- }); >- }); >- promises.push(fullscreenPromise); >- } >+ // Wait for a rAF call before proceeding. >+ await new Promise((resolve) => session.requestAnimationFrame(resolve)); > >- return Promise.all(promises); >+ assert_implements_optional(document.fullscreenElement == overlayElement, >+ "WebXR DOM overlay is not using Fullscreen API"); >+ let elem = document.getElementById('div_other'); >+ assert_not_equals(elem, null); >+ assert_not_equals(elem, overlayElement); >+ >+ try { >+ await elem.requestFullscreen(); >+ assert_unreached("fullscreen change should be blocked"); >+ } catch { >+ // pass if the call rejects >+ } >+ // This is an async function, its return value is automatically a promise. > }; > > let watcherStep = new Event("watcherstep"); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/idlharness.https.window.js b/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/idlharness.https.window.js >index ca20f4253898937c61aac108d9caeef1d39e2831..7fadbdbc2b4ff9810861e90683741bd3ea985b0b 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/idlharness.https.window.js >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/idlharness.https.window.js >@@ -7,10 +7,14 @@ > > idl_test( > ['dom-overlays'], >- ['webxr', 'html', 'dom'], >+ ['webxr', 'html', 'dom', 'SVG'], > async idl_array => { >+ self.svgElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); > idl_array.add_objects({ >- // TODO: Add object instances >+ Document: ['document'], >+ HTMLElement: ['document.body'], >+ SVGElement: ['svgElement'], >+ Window: ['window'] > }); > } > ); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/nested_fullscreen.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/nested_fullscreen.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..a8fc70fca6a7c33af4287d92a4318cca621ca0bd >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/nested_fullscreen.https.html >@@ -0,0 +1,81 @@ >+<!DOCTYPE html> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="/resources/testdriver.js"></script> >+<script src="/resources/testdriver-vendor.js"></script> >+<script src="../resources/webxr_util.js"></script> >+<script src="../resources/webxr_test_constants.js"></script> >+<script src="../resources/webxr_test_asserts.js"></script> >+ >+<style type="text/css"> >+ div { >+ padding: 10px; >+ min-width: 10px; >+ min-height: 10px; >+ } >+ iframe { >+ border: 0; >+ width: 20px; >+ height: 20px; >+ } >+</style> >+<div id="div_overlay"> >+ <canvas> >+ </canvas> >+</div> >+<div id="div_other"> >+ <p>test text</p> >+</div> >+ >+<script> >+ >+const fakeDeviceInitParams = { >+ supportedModes: ["immersive-ar"], >+ views: VALID_VIEWS, >+ viewerOrigin: IDENTITY_TRANSFORM, >+ supportedFeatures: ALL_FEATURES, >+}; >+ >+// This test verifies that WebXR DOM Overlay mode works when the document is >+// already in fullscreen mode when the session starts. (This should work both >+// for a fullscreen-based overlay implementation and for one that treats the >+// overlay as an independent output.) >+promise_test( >+ async (setup) => { >+ setup.add_cleanup(() => document.exitFullscreen()); >+ >+ // Fullscreen the <body> element before running the test. Currently, this >+ // can't be an arbitrary element because the simulateUserActivation call >+ // adds a button to <body> which is only clickable if it's visible. >+ await test_driver.bless("fullscreen", >+ () => document.body.requestFullscreen()); >+ >+ const overlayElement = document.getElementById('div_overlay'); >+ >+ xr_session_promise_test( >+ "Check XR session from fullscreen", >+ (session, fakeDeviceController, t) => { >+ // The overlay element should have a transparent background. >+ assert_equals(window.getComputedStyle(overlayElement).backgroundColor, >+ 'rgba(0, 0, 0, 0)'); >+ >+ // Check that the pseudostyle is set. >+ assert_equals(document.querySelector(':xr-overlay'), overlayElement); >+ >+ // Wait for one animation frame before exiting. >+ return new Promise((resolve) => session.requestAnimationFrame(resolve)); >+ }, >+ fakeDeviceInitParams, 'immersive-ar', { >+ requiredFeatures: ['dom-overlay'], >+ domOverlay: { root: overlayElement } >+ } >+ ); >+ >+ // The setup promise_test automatically succeeds if it gets here >+ // without raising an exception. It'll pass even on systems that >+ // don't support WebXR or DOM Overlay. >+ }, >+ "fullscreen setup" >+); >+ >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/w3c-import.log >index 6e95448c0129992778873b9b6b7e00a4b7ccce2a..b46332ff1375fe4557bcd04da535db66194913d0 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/w3c-import.log >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/w3c-import.log >@@ -14,6 +14,8 @@ Property values requiring vendor prefixes: > None > ------------------------------------------------------------------------ > List of files: >+/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/META.yml > /LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/ar_dom_overlay.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/ar_dom_overlay_hit_test.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/idlharness.https.window.js >+/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/nested_fullscreen.https.html >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_source_recreation.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_source_recreation.https-expected.txt >index d7051e9206fa4bdd89fb81b4eb0b090ba22b0472..d9e359fe38542fb89d374a532ac67997b66e8ad3 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_source_recreation.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_source_recreation.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS Input sources are re-created when handedness or target ray mode changes >+PASS Input sources are re-created when handedness or target ray mode changes - webgl >+FAIL Input sources are re-created when handedness or target ray mode changes - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_source_recreation.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_source_recreation.https.html >index ecb4b022bf09410cae44b4f5a3c71bc5c054181e..f7ef86c27321106eeaec50b91333bf4a5d3f8569 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_source_recreation.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_source_recreation.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "Input sources are re-created when handedness or target ray mode changes"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_sources_change.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_sources_change.https-expected.txt >index 38db126062fbf26e5ae0b339589901a8ed8beedf..a2eed3782dc85be6467496a095b3fe43208697eb 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_sources_change.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_sources_change.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS Transient input sources fire events in the right order >+PASS Transient input sources fire events in the right order - webgl >+FAIL Transient input sources fire events in the right order - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_sources_change.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_sources_change.https.html >index 7c784c34479842148a3310b3f48d41990fcd4c34..b2a17d4e17ae03bf7ed51e07095aa36dcce033a3 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_sources_change.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_sources_change.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "Transient input sources fire events in the right order"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_referenceSpace_reset_immersive.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_referenceSpace_reset_immersive.https.html >index 9643bf61c877ed50fa70e49015828e1b58ba7870..d12d8f77379010a57bbf69a1f9636e098854808a 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_referenceSpace_reset_immersive.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_referenceSpace_reset_immersive.https.html >@@ -3,7 +3,6 @@ > <script src=/resources/testharnessreport.js></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let immersiveTestName = "XRSession resetpose from a device properly fires off " + >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_referenceSpace_reset_inline.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_referenceSpace_reset_inline.https.html >index b3abcc817bdf3e53c22284a14d03e31e1184e1a3..a445886a52daa7d4c27873292e66cf53291a5446 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_referenceSpace_reset_inline.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_referenceSpace_reset_inline.https.html >@@ -3,7 +3,6 @@ > <script src=/resources/testharnessreport.js></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let nonImmersiveTestName = "XRSession resetpose from a device properly fires off " + >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select.https-expected.txt >index 92169e98002e9f0f89ef8744c73900e3ae23559b..602bbdbaa06c4135deece508b0081661441bd359 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRInputSources primary input presses properly fires off the right events >+PASS XRInputSources primary input presses properly fires off the right events - webgl >+FAIL XRInputSources primary input presses properly fires off the right events - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select.https.html >index f83d3c4f85421999d2480049dc4daa62acf07666..9b7402d2b65b37f21e8e7b5f0548f72a136b26f5 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "XRInputSources primary input presses properly fires off the " >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select_subframe.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select_subframe.https-expected.txt >index 7d3dfbe31f2b50eacea285527b2292a51f5272e6..51b2896568e7c68d9b1249044172b86b83669668 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select_subframe.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select_subframe.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS Ensures that an XRInputSources primary input being pressed and released in the space of a single frame properly fires off the right events >+PASS Ensures that an XRInputSources primary input being pressed and released in the space of a single frame properly fires off the right events - webgl >+FAIL Ensures that an XRInputSources primary input being pressed and released in the space of a single frame properly fires off the right events - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select_subframe.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select_subframe.https.html >index 96fa11713dd480b947b0c64b624dc6022cb7e8d0..b7615c3d0b42178ceb0e73ed168b0740a561f1bc 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select_subframe.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select_subframe.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "Ensures that an XRInputSources primary input being pressed and " >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_squeeze.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_squeeze.https-expected.txt >index 92169e98002e9f0f89ef8744c73900e3ae23559b..602bbdbaa06c4135deece508b0081661441bd359 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_squeeze.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_squeeze.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRInputSources primary input presses properly fires off the right events >+PASS XRInputSources primary input presses properly fires off the right events - webgl >+FAIL XRInputSources primary input presses properly fires off the right events - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_squeeze.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_squeeze.https.html >index 101f1dc7c886906a9f6bc9db8bba0e01fdcb4b73..122fe340a272f06e4cb7fdaaf0586e487d5e9998 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_squeeze.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_squeeze.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "XRInputSources primary input presses properly fires off the " >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/exclusive_requestFrame_nolayer.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/exclusive_requestFrame_nolayer.https.html >index f76847a8769073bb4753702f32dd5c2ccc9d3532..c1c52f03746cf6aec64704b2ea9c6861bce08fd7 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/exclusive_requestFrame_nolayer.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/exclusive_requestFrame_nolayer.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas /> > > <script> > let immersiveTestName = "XRSession requestAnimationFrame must fail if the session has " >@@ -21,7 +20,6 @@ let testFunction = (session, controller, t, sessionObjects) => new Promise((reso > session.updateRenderState({ > baseLayer: null > }); >- let webglCanvas = document.getElementsByTagName('canvas')[0]; > let gl = sessionObjects.gl; > > // Session must have a baseLayer or frame requests will be ignored. >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/META.yml b/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/META.yml >new file mode 100644 >index 0000000000000000000000000000000000000000..a6751571a701f681bef89e09350cbd7a11c90d2f >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/META.yml >@@ -0,0 +1 @@ >+spec: https://immersive-web.github.io/webxr-gamepads-module/ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/w3c-import.log >index 1f1edc4d4922af9ef016250cebc0da9aa3c24ae9..8416b4476b64e899d48b788676a98af6811aec45 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/w3c-import.log >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/w3c-import.log >@@ -14,6 +14,7 @@ Property values requiring vendor prefixes: > None > ------------------------------------------------------------------------ > List of files: >+/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/META.yml > /LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/idlharness.https.window.js > /LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_disconnect.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_input_registered.https.html >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_disconnect.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_disconnect.https.html >index f69f943b5b58451f75a4f21ac149676066d1f799..bd69649d443ec856f77f1369c02dde5fe9152eee 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_disconnect.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_disconnect.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="../resources/webxr_util.js"></script> > <script src="../resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "WebXR InputSource's gamepad gets disconnected when the input source is removed"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_input_registered.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_input_registered.https.html >index 1ff9dcf3b40c9a9c9f41fcc756f6bab1d3add7b3..28f308467118bac8e8ce1c48209eeaef3355a67d 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_input_registered.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_input_registered.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="../resources/webxr_util.js"></script> > <script src="../resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "WebXR InputSource's gamepad properly registers input"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/getInputPose_handedness.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/getInputPose_handedness.https-expected.txt >index 089e7ae3ebebf1e614a35b4bb73b18da51542e3f..693385ce755d5871270192ca2e24ebbf4b8122ab 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/getInputPose_handedness.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/getInputPose_handedness.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRInputSources properly communicate their handedness >+PASS XRInputSources properly communicate their handedness - webgl >+FAIL XRInputSources properly communicate their handedness - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/getInputPose_handedness.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/getInputPose_handedness.https.html >index c5c13fd08f4ec43cb33155c9ea92ad2177b6035e..9dbaf3b629d607d1d69a8d328b626dac6e62cb92 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/getInputPose_handedness.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/getInputPose_handedness.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/getInputPose_pointer.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/getInputPose_pointer.https.html >index 30dbe4c5304a33d2131548d8c168c85225cd4b82..302dc399eee983f837ac69b6e7538a5d91e2fbca 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/getInputPose_pointer.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/getInputPose_pointer.https.html >@@ -4,7 +4,6 @@ > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> > <script src="resources/webxr_test_asserts.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/getViewerPose_emulatedPosition.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/getViewerPose_emulatedPosition.https-expected.txt >index 0753899ca98ff9383926a5e3e45a02d9510f93a8..04f94446a661ed1c4c2f70e26099ffa78e906f99 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/getViewerPose_emulatedPosition.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/getViewerPose_emulatedPosition.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRFrame getViewerPose has emulatedPosition set properly. >+PASS XRFrame getViewerPose has emulatedPosition set properly. - webgl >+FAIL XRFrame getViewerPose has emulatedPosition set properly. - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/getViewerPose_emulatedPosition.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/getViewerPose_emulatedPosition.https.html >index acba79136a2925ef8c37ffe0a992c5a8da967976..7bffaf51a5fc0c7e027c8813becaee0105040c9e 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/getViewerPose_emulatedPosition.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/getViewerPose_emulatedPosition.https.html >@@ -4,7 +4,6 @@ > <script src=/resources/testharnessreport.js></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >- <canvas></canvas> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/hand-input/META.yml b/LayoutTests/imported/w3c/web-platform-tests/webxr/hand-input/META.yml >new file mode 100644 >index 0000000000000000000000000000000000000000..caa72f8632b5987ecd245b249c97c81d853c8e6b >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/hand-input/META.yml >@@ -0,0 +1 @@ >+spec: https://immersive-web.github.io/webxr-hand-input/ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/hand-input/idlharness.https.window.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/hand-input/idlharness.https.window.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/hand-input/idlharness.https.window.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/hand-input/idlharness.https.window.js b/LayoutTests/imported/w3c/web-platform-tests/webxr/hand-input/idlharness.https.window.js >new file mode 100644 >index 0000000000000000000000000000000000000000..184ec6b3060a45a2ebcd9f0268f5bbdf7353a250 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/hand-input/idlharness.https.window.js >@@ -0,0 +1,16 @@ >+// META: script=/resources/WebIDLParser.js >+// META: script=/resources/idlharness.js >+ >+'use strict'; >+ >+// https://immersive-web.github.io/webxr-hand-input/ >+ >+idl_test( >+ ['webxr-hand-input'], >+ ['webxr', 'dom'], >+ async idl_array => { >+ idl_array.add_objects({ >+ // TODO >+ }); >+ } >+); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/hand-input/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/webxr/hand-input/w3c-import.log >new file mode 100644 >index 0000000000000000000000000000000000000000..c2c93fe80204417c5ef9ee80761d06990c1098e6 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/hand-input/w3c-import.log >@@ -0,0 +1,18 @@ >+The tests in this directory were imported from the W3C repository. >+Do NOT modify these tests directly in WebKit. >+Instead, create a pull request on the WPT github: >+ https://github.com/web-platform-tests/wpt >+ >+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport >+ >+Do NOT modify or remove this file. >+ >+------------------------------------------------------------------------ >+Properties requiring vendor prefixes: >+None >+Property values requiring vendor prefixes: >+None >+------------------------------------------------------------------------ >+List of files: >+/LayoutTests/imported/w3c/web-platform-tests/webxr/hand-input/META.yml >+/LayoutTests/imported/w3c/web-platform-tests/webxr/hand-input/idlharness.https.window.js >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/META.yml b/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/META.yml >new file mode 100644 >index 0000000000000000000000000000000000000000..e3f94f05a1ffc60dde730e76faaba8bbb1aae1b1 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/META.yml >@@ -0,0 +1 @@ >+spec: https://immersive-web.github.io/hit-test/ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_source_cancel.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_source_cancel.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..5e7381df02def47929c3792740a750168dbd046c >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_source_cancel.https.html >@@ -0,0 +1,100 @@ >+<!DOCTYPE html> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="../resources/webxr_util.js"></script> >+<script src="../resources/webxr_test_asserts.js"></script> >+<script src="../resources/webxr_test_constants.js"></script> >+<script src="../resources/webxr_test_constants_fake_world.js"></script> >+ >+<script> >+ >+// at world origin. >+const VIEWER_ORIGIN_TRANSFORM = { >+ position: [0, 0, 0], >+ orientation: [0, 0, 0, 1], >+}; >+ >+// at world origin. >+const FLOOR_ORIGIN_TRANSFORM = { >+ position: [0, 0, 0], >+ orientation: [0, 0, 0, 1], >+}; >+ >+const fakeDeviceInitParams = { >+ supportedModes: ["immersive-ar"], >+ views: VALID_VIEWS, >+ floorOrigin: FLOOR_ORIGIN_TRANSFORM, // aka mojo_from_floor >+ viewerOrigin: VIEWER_ORIGIN_TRANSFORM, // aka mojo_from_viewer >+ supportedFeatures: ALL_FEATURES, >+ world: createFakeWorld(5.0, 2.0, 5.0), // webxr_test_constants_fake_world.js has detailed description of the fake world >+}; >+ >+const test_function_generator = function(isTransientTest, isSessionEndedTest) { >+ return function(session, fakeDeviceController, t) { >+ >+ let done = false; >+ >+ return session.requestReferenceSpace('local').then((localSpace) => { >+ const validation_function = (hitTestSource) => { >+ >+ const rAFcb = function(time, frame) { >+ if(isSessionEndedTest) { >+ // Session is marked as "ended" synchronously, there is no need to >+ // wait for the promise it returns to settle. >+ session.end(); >+ >+ // Currently, the specification does not say what happen >+ // when a hit test source gets cancelled post-session-end. >+ hitTestSource.cancel(); >+ done = true; >+ } else { >+ hitTestSource.cancel(); >+ t.step(() => { >+ assert_throws_dom("InvalidStateError", () => hitTestSource.cancel()); >+ }); >+ done = true; >+ } >+ }; >+ >+ session.requestAnimationFrame(rAFcb); >+ >+ return t.step_wait(() => done); >+ }; >+ >+ // Same validation will happen both in transient and non-transient variant >+ if(isTransientTest) { >+ return session.requestHitTestSourceForTransientInput({ >+ profile: "generic-touchscreen", >+ offsetRay: new XRRay(), >+ }).then(validation_function); >+ } else { >+ return session.requestHitTestSource({ >+ space: localSpace, >+ offsetRay: new XRRay(), >+ }).then(validation_function); >+ } >+ }); // return session.requestReferenceSpace('local').then((localSpace) => { ... >+ }; // return function(session, fakeDeviceController, t) { ... >+} >+ >+xr_session_promise_test("Ensures hit test source cancellation works when the session has not ended.", >+ test_function_generator(/*isTransientTest=*/false, /*isSessionEndedTest=*/false), >+ fakeDeviceInitParams, >+ 'immersive-ar', { 'requiredFeatures': ['hit-test'] }); >+ >+xr_session_promise_test("Ensures transient input hit test source cancellation works when the session has not ended.", >+ test_function_generator(/*isTransientTest=*/true, /*isSessionEndedTest=*/false), >+ fakeDeviceInitParams, >+ 'immersive-ar', { 'requiredFeatures': ['hit-test'] }); >+ >+xr_session_promise_test("Ensures hit test source cancellation works when the session has ended", >+ test_function_generator(/*isTransientTest=*/false, /*isSessionEndedTest=*/true), >+ fakeDeviceInitParams, >+ 'immersive-ar', { 'requiredFeatures': ['hit-test'] }); >+ >+xr_session_promise_test("Ensures transient input hit test source cancellation works when the session has ended", >+ test_function_generator(/*isTransientTest=*/true, /*isSessionEndedTest=*/true), >+ fakeDeviceInitParams, >+ 'immersive-ar', { 'requiredFeatures': ['hit-test'] }); >+ >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_inputSources.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_inputSources.https.html >index d419055ab264276ab6c2c2f064ab11785440bdfe..ca92d390fc6c913410b10fd2c656f544ac1e5317 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_inputSources.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_inputSources.https.html >@@ -2,10 +2,10 @@ > <script src="/resources/testharness.js"></script> > <script src="/resources/testharnessreport.js"></script> > <script src="../resources/webxr_util.js"></script> >+<script src="../resources/webxr_math_utils.js"></script> > <script src="../resources/webxr_test_asserts.js"></script> > <script src="../resources/webxr_test_constants.js"></script> > <script src="../resources/webxr_test_constants_fake_world.js"></script> >-<canvas /> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_refSpaces.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_refSpaces.https.html >index f1c223ae7495390fdd2592f24e29869663cde931..a30e71949c9d6af6c81f1095b90c27a899b0b3f3 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_refSpaces.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_refSpaces.https.html >@@ -2,10 +2,10 @@ > <script src="/resources/testharness.js"></script> > <script src="/resources/testharnessreport.js"></script> > <script src="../resources/webxr_util.js"></script> >+<script src="../resources/webxr_math_utils.js"></script> > <script src="../resources/webxr_test_asserts.js"></script> > <script src="../resources/webxr_test_constants.js"></script> > <script src="../resources/webxr_test_constants_fake_world.js"></script> >-<canvas /> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_regular.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_regular.https.html >index 0678ff55cef90620e55bbd893ff2fc16e1a69252..9f5513fd1e73f034267e7171c95986dbcfbd54e2 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_regular.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_regular.https.html >@@ -5,7 +5,6 @@ > <script src="../resources/webxr_test_asserts.js"></script> > <script src="../resources/webxr_test_constants.js"></script> > <script src="../resources/webxr_test_constants_fake_world.js"></script> >-<canvas /> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_transient.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_transient.https.html >index accd4bbf70f716faf9885ca6e3088ceab48493ef..e8a83a62a60929ec7f2625bc1bb522a13de94089 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_transient.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_transient.https.html >@@ -5,7 +5,6 @@ > <script src="../resources/webxr_test_asserts.js"></script> > <script src="../resources/webxr_test_constants.js"></script> > <script src="../resources/webxr_test_constants_fake_world.js"></script> >-<canvas /> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_transientInputSources.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_transientInputSources.https.html >index e38e9c601b312f1207cce29bd64d588381275e3c..9e0347963c64fb1d481d23f6d8b6249274dcd7f7 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_transientInputSources.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_transientInputSources.https.html >@@ -2,10 +2,10 @@ > <script src="/resources/testharness.js"></script> > <script src="/resources/testharnessreport.js"></script> > <script src="../resources/webxr_util.js"></script> >+<script src="../resources/webxr_math_utils.js"></script> > <script src="../resources/webxr_test_asserts.js"></script> > <script src="../resources/webxr_test_constants.js"></script> > <script src="../resources/webxr_test_constants_fake_world.js"></script> >-<canvas /> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/w3c-import.log >index d8ca6d597fa5f67185a0d858bc8961a415bdd369..e36663a3885250c33832321f4ab5579565718461 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/w3c-import.log >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/w3c-import.log >@@ -14,6 +14,8 @@ Property values requiring vendor prefixes: > None > ------------------------------------------------------------------------ > List of files: >+/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/META.yml >+/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_source_cancel.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_inputSources.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_refSpaces.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_regular.https.html >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/layers/META.yml b/LayoutTests/imported/w3c/web-platform-tests/webxr/layers/META.yml >new file mode 100644 >index 0000000000000000000000000000000000000000..117c1adf021812164c4941a8321c9fc0661f1b67 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/layers/META.yml >@@ -0,0 +1 @@ >+spec: https://immersive-web.github.io/layers/ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/layers/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/webxr/layers/w3c-import.log >new file mode 100644 >index 0000000000000000000000000000000000000000..8d755ff901bdf7bac832efd9034084a9a07e819b >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/layers/w3c-import.log >@@ -0,0 +1,18 @@ >+The tests in this directory were imported from the W3C repository. >+Do NOT modify these tests directly in WebKit. >+Instead, create a pull request on the WPT github: >+ https://github.com/web-platform-tests/wpt >+ >+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport >+ >+Do NOT modify or remove this file. >+ >+------------------------------------------------------------------------ >+Properties requiring vendor prefixes: >+None >+Property values requiring vendor prefixes: >+None >+------------------------------------------------------------------------ >+List of files: >+/LayoutTests/imported/w3c/web-platform-tests/webxr/layers/META.yml >+/LayoutTests/imported/w3c/web-platform-tests/webxr/layers/xrWebGLBinding_constructor.https.html >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/layers/xrWebGLBinding_constructor.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/layers/xrWebGLBinding_constructor.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b3457cf3203005562785b0a93f8e462c01addbc8 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/layers/xrWebGLBinding_constructor.https.html >@@ -0,0 +1,83 @@ >+<!DOCTYPE html> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="../resources/webxr_util.js"></script> >+<script src="../resources/webxr_test_constants.js"></script> >+ >+<script> >+ >+function testConstructor(t, gl) { >+ return navigator.xr.test.simulateDeviceConnection(TRACKED_IMMERSIVE_DEVICE) >+ .then(() => { >+ return navigator.xr.requestSession('inline') >+ .then((session) => { >+ try { >+ let webglLayerIncompatible = new XRWebGLBinding(session, gl); >+ assert_unreached("XRWebGLBinding should fail when created with an inline session."); >+ } catch (err) { >+ assert_equals(err.name, "InvalidStateError", "Should get InvalidStateError for creating with inline session."); >+ } >+ }); >+ }) >+ .then(() => { >+ return new Promise((resolve) => { >+ navigator.xr.test.simulateUserActivation(() => { >+ let xrSession = null; >+ navigator.xr.requestSession('immersive-vr') >+ .then((session) => { >+ xrSession = session; >+ t.step_func(() => { >+ try { >+ let webglLayerIncompatible = new XRWebGLBinding(xrSession, gl); >+ assert_unreached("XRWebGLBinding should fail when created with a context that is not XRCompatible.") >+ } catch (err) { >+ assert_equals(err.name, "InvalidStateError", "Should get InvalidStateError for non-XRCompatible context."); >+ } >+ }) >+ >+ return gl.makeXRCompatible(); >+ }).then(() => { >+ try { >+ let webglLayerGood = new XRWebGLBinding(xrSession, gl); >+ } catch (err) { >+ reject("XRWebGLBinding should not fail with valid arguments."); >+ } >+ >+ let lose_context_ext = gl.getExtension('WEBGL_lose_context'); >+ >+ gl.canvas.addEventListener('webglcontextlost', (ev) => { >+ ev.preventDefault(); >+ >+ try { >+ let webglLayerBadContext = new XRWebGLBinding(xrSession, gl); >+ reject("XRWebGLBinding should fail when created with a lost context."); >+ } catch (err) { >+ assert_equals(err.name, 'InvalidStateError', "Should get InvalidStateError for lost context."); >+ t.step_timeout(() => { lose_context_ext.restoreContext(); }, 100); >+ } >+ }); >+ >+ gl.canvas.addEventListener('webglcontextrestored', (ev) => { >+ resolve(xrSession.end().then(() => { >+ try { >+ let webglLayerBadSession = new XRWebGLBinding(xrSession, gl); >+ assert_unreached("XRWebGLBinding should fail when created with an ended session."); >+ } catch (err) { >+ assert_equals(err.name, 'InvalidStateError', "Should get InvalidStateError when passed an ended session."); >+ } >+ })); >+ }); >+ >+ lose_context_ext.loseContext(); >+ }); >+ }); >+ }); >+ }); >+} >+xr_promise_test("Ensure that XRWebGLBinding's constructor throws appropriate errors using webgl", >+ testConstructor, null, 'webgl'); >+ >+xr_promise_test("Ensure that XRWebGLBinding's constructor throws appropriate errors using webgl2", >+ testConstructor, null, 'webgl2'); >+ >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/w3c-import.log >new file mode 100644 >index 0000000000000000000000000000000000000000..7321768a3e2154e4516e7253d4aa182eef659c65 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/w3c-import.log >@@ -0,0 +1,23 @@ >+The tests in this directory were imported from the W3C repository. >+Do NOT modify these tests directly in WebKit. >+Instead, create a pull request on the WPT github: >+ https://github.com/web-platform-tests/wpt >+ >+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport >+ >+Do NOT modify or remove this file. >+ >+------------------------------------------------------------------------ >+Properties requiring vendor prefixes: >+None >+Property values requiring vendor prefixes: >+None >+------------------------------------------------------------------------ >+List of files: >+/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrFrame_getLightEstimate_oldSession.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrFrame_getLightEstimate_staleFrame.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrFrame_getLightEstimate_valid.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrSession_getLightProbe_ended.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrSession_getLightProbe_notEnabled.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrSession_getLightProbe_valid.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrWebGLBinding_getReflectionCubeMap.https.html >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrFrame_getLightEstimate_oldSession.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrFrame_getLightEstimate_oldSession.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..7a896aa9ff7657733a95ffa8011489a9d29f2764 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrFrame_getLightEstimate_oldSession.https.html >@@ -0,0 +1,57 @@ >+<!DOCTYPE html> >+<body> >+ <script src=/resources/testharness.js></script> >+ <script src=/resources/testharnessreport.js></script> >+ <script src="../resources/webxr_util.js"></script> >+ <script src="../resources/webxr_test_constants.js"></script> >+ >+ <script> >+ let testName = "getLightEstimate rejects if probe is from wrong session"; >+ let testFunction = (session, controller, t, sessionObjects) => new Promise((resolve) => { >+ let staleLightProbe = null; >+ let newSession = null; >+ >+ function onFrame(time, frame) { >+ t.step(() => { >+ // Attempting to get a lightEstimate with a probe created for a >+ // different session should throw an exception. >+ assert_throws_dom('InvalidStateError', () => frame.getLightEstimate(staleLightProbe)); >+ }); >+ >+ // Cleanup the new session we made and then resolve. >+ resolve(newSession.end()); >+ } >+ >+ // Request a default lightProbe >+ let probeInit = {reflectionFormat: session.preferredReflectionFormat }; >+ session.requestLightProbe(probeInit).then((probe) => { >+ staleLightProbe = probe; >+ return session.end(); >+ }).then(() => { >+ // Need to request a new session. >+ navigator.xr.test.simulateUserActivation( () => { >+ navigator.xr.requestSession('immersive-ar', {'requiredFeatures': ['light-estimation']}) >+ .then((session2) => { >+ >+ let glLayer = new XRWebGLLayer(session2, sessionObjects.gl); >+ glLayer.context = sessionObjects.gl; >+ // Session must have a baseLayer or frame requests will be ignored. >+ session2.updateRenderState({ >+ baseLayer: glLayer >+ }); >+ newSession = session2; >+ newSession.requestAnimationFrame(onFrame); >+ }); >+ }); >+ }); >+ }); >+ >+ xr_session_promise_test( >+ testName, >+ testFunction, >+ IMMERSIVE_AR_DEVICE, >+ 'immersive-ar', >+ {'requiredFeatures': ['light-estimation']}); >+ >+ </script> >+</body> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrFrame_getLightEstimate_staleFrame.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrFrame_getLightEstimate_staleFrame.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..499a30d56116d49d456636d3070797907fde1f32 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrFrame_getLightEstimate_staleFrame.https.html >@@ -0,0 +1,47 @@ >+<!DOCTYPE html> >+<body> >+ <script src=/resources/testharness.js></script> >+ <script src=/resources/testharnessreport.js></script> >+ <script src="../resources/webxr_util.js"></script> >+ <script src="../resources/webxr_test_constants.js"></script> >+ >+ <script> >+ let testName = "Cannot get XrLightEstimate from stale frame"; >+ let testFunction = (session, controller, t) => new Promise((resolve) => { >+ let lightProbe = null; >+ let staleFrame = null; >+ >+ function onFrame(time, frame) { >+ // Try to get the light estimate (even if it's null), it shouldn't throw. >+ let estimate = frame.getLightEstimate(lightProbe); >+ staleFrame = frame; >+ >+ t.step_timeout(afterFrame, 10); >+ } >+ >+ function afterFrame() { >+ t.step(() => { >+ // Attempting to call a method on the frame outside the callback that >+ // originally provided it should cause it to throw an exception. >+ assert_throws_dom('InvalidStateError', () => staleFrame.getLightEstimate(lightProbe)); >+ }); >+ >+ resolve(); >+ } >+ >+ // Request a default lightProbe >+ let probeInit = {reflectionFormat: session.preferredReflectionFormat}; >+ session.requestLightProbe(probeInit).then((probe) => { >+ lightProbe = probe; >+ session.requestAnimationFrame(onFrame); >+ }); >+ }); >+ >+ xr_session_promise_test( >+ testName, >+ testFunction, >+ IMMERSIVE_AR_DEVICE, >+ 'immersive-ar', {'requiredFeatures': ['light-estimation']}); >+ >+ </script> >+</body> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrFrame_getLightEstimate_valid.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrFrame_getLightEstimate_valid.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..68c5d841fcb3724a1674b5b5c77814385d73b7fe >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrFrame_getLightEstimate_valid.https.html >@@ -0,0 +1,104 @@ >+<!DOCTYPE html> >+<body> >+ <script src=/resources/testharness.js></script> >+ <script src=/resources/testharnessreport.js></script> >+ <script src="../resources/webxr_util.js"></script> >+ <script src="../resources/webxr_test_asserts.js"></script> >+ <script src="../resources/webxr_test_constants.js"></script> >+ >+ <script> >+ let testName = "Can get XRLightEstimates during frame"; >+ let fakeDeviceInitParams = IMMERSIVE_AR_DEVICE; >+ >+ let fakeEstimateCoefficients = [ >+ 0.01, 0.02, 0.03, >+ 0.04, 0.05, 0.06, >+ 0.07, 0.08, 0.09, >+ 0.10, 0.11, 0.12, >+ 0.13, 0.14, 0.15, >+ 0.16, 0.17, 0.18, >+ 0.19, 0.20, 0.21, >+ 0.22, 0.23, 0.24, >+ 0.25, 0.26, 0.27 >+ ]; >+ >+ let fakeDirectionInit = { x: 1.0, y: 0.0, z: 0.0, w: 0.0 }; >+ let fakeIntensityInit = { x: 0.0, y: 0.0, z: 1.0, w: 1.0 }; >+ >+ let testFunction = (session, controller, t) => new Promise((resolve) => { >+ let lightProbe = null; >+ function onFrameWithNoLightEstimation(time, frame) { >+ let estimate = frame.getLightEstimate(lightProbe); >+ t.step(() => { >+ assert_equals(estimate, null); >+ }); >+ >+ controller.setLightEstimate({ >+ sphericalHarmonicsCoefficients: fakeEstimateCoefficients >+ }); >+ >+ requestSkipAnimationFrame(session, onFrameWithCoefficients); >+ } >+ >+ function onFrameWithCoefficients(time, frame) { >+ let estimate = frame.getLightEstimate(lightProbe); >+ t.step(() => { >+ assert_not_equals(estimate, null); >+ assert_equals(estimate.sphericalHarmonicsCoefficients.length, 27); >+ assert_point_approx_equals(estimate.primaryLightDirection, { x: 0.0, y: 1.0, z: 0.0, w: 0.0 }); >+ assert_point_approx_equals(estimate.primaryLightIntensity, { x: 0.0, y: 0.0, z: 0.0, w: 1.0 }); >+ }); >+ >+ controller.setLightEstimate({ >+ sphericalHarmonicsCoefficients: fakeEstimateCoefficients, >+ primaryLightDirection: fakeDirectionInit, >+ }); >+ >+ requestSkipAnimationFrame(session, onFrameWithDirection); >+ } >+ >+ function onFrameWithDirection(time, frame) { >+ let estimate = frame.getLightEstimate(lightProbe); >+ t.step(() => { >+ assert_not_equals(estimate, null); >+ assert_equals(estimate.sphericalHarmonicsCoefficients.length, 27); >+ assert_point_approx_equals(estimate.primaryLightDirection, fakeDirectionInit); >+ assert_point_approx_equals(estimate.primaryLightIntensity, { x: 0.0, y: 0.0, z: 0.0, w: 1.0 }); >+ }); >+ >+ controller.setLightEstimate({ >+ sphericalHarmonicsCoefficients: fakeEstimateCoefficients, >+ primaryLightDirection: fakeDirectionInit, >+ primaryLightIntensity: fakeIntensityInit >+ }); >+ >+ requestSkipAnimationFrame(session, onFrameWithDirectionAndIntensity); >+ } >+ >+ function onFrameWithDirectionAndIntensity(time, frame) { >+ let estimate = frame.getLightEstimate(lightProbe); >+ t.step(() => { >+ assert_not_equals(estimate, null); >+ assert_equals(estimate.sphericalHarmonicsCoefficients.length, 27); >+ assert_point_approx_equals(estimate.primaryLightDirection, fakeDirectionInit); >+ assert_point_approx_equals(estimate.primaryLightIntensity, fakeIntensityInit); >+ }); >+ >+ resolve(); >+ } >+ >+ // Request a default lightProbe >+ session.requestLightProbe({reflectionFormat: session.preferredReflectionFormat }).then((probe) => { >+ lightProbe = probe; >+ session.requestAnimationFrame(onFrameWithNoLightEstimation); >+ }); >+ }); >+ >+ xr_session_promise_test( >+ testName, >+ testFunction, >+ IMMERSIVE_AR_DEVICE, >+ 'immersive-ar', {'requiredFeatures': ['light-estimation']}); >+ >+ </script> >+</body> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrSession_getLightProbe_ended.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrSession_getLightProbe_ended.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..cc046499f9748048303c8afff916ad66be3b2a0e >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrSession_getLightProbe_ended.https.html >@@ -0,0 +1,21 @@ >+<!DOCTYPE html> >+<body> >+ <script src=/resources/testharness.js></script> >+ <script src=/resources/testharnessreport.js></script> >+ <script src="../resources/webxr_util.js"></script> >+ <script src="../resources/webxr_test_constants.js"></script> >+ >+ <script> >+ xr_session_promise_test( >+ "getLightProbe rejects on an ended session", >+ (session, controller, t) => { >+ return session.end().then(() => { >+ return promise_rejects_dom(t, "InvalidStateError", session.requestLightProbe()) >+ }) >+ }, >+ IMMERSIVE_AR_DEVICE, >+ 'immersive-ar', >+ {'requiredFeatures': ['light-estimation']}); >+ >+ </script> >+</body> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrSession_getLightProbe_notEnabled.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrSession_getLightProbe_notEnabled.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..23fe1c6ec5cddae336f64764f391d2e790c9261b >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrSession_getLightProbe_notEnabled.https.html >@@ -0,0 +1,18 @@ >+<!DOCTYPE html> >+<body> >+ <script src=/resources/testharness.js></script> >+ <script src=/resources/testharnessreport.js></script> >+ <script src="../resources/webxr_util.js"></script> >+ <script src="../resources/webxr_test_constants.js"></script> >+ >+ <script> >+ let fakeDeviceInitParams = IMMERSIVE_AR_DEVICE; >+ >+ xr_session_promise_test( >+ "getLightProbe rejects if not enabled on session", >+ (session, controller, t) => promise_rejects_dom(t, "NotSupportedError", session.requestLightProbe()), >+ IMMERSIVE_AR_DEVICE, >+ 'immersive-ar'); >+ >+ </script> >+</body> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrSession_getLightProbe_valid.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrSession_getLightProbe_valid.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..074c7fd1dcfc2edaf3616cc23c13a16ba869e806 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrSession_getLightProbe_valid.https.html >@@ -0,0 +1,27 @@ >+<!DOCTYPE html> >+<body> >+ <script src=/resources/testharness.js></script> >+ <script src=/resources/testharnessreport.js></script> >+ <script src="../resources/webxr_util.js"></script> >+ <script src="../resources/webxr_test_constants.js"></script> >+ >+ <script> >+ let testName = "Can create valid XRLightProbe objects"; >+ >+ function testFunction(session, controller, t) { >+ // Request a default lightProbe >+ let defaultProbe = session.requestLightProbe(); >+ let srgba8Probe = session.requestLightProbe({reflectionFormat: "srgba8"}); >+ let preferredProbe = session.requestLightProbe({reflectionFormat: session.preferredReflectionFormat }); >+ >+ return Promise.all([defaultProbe, srgba8Probe, preferredProbe]); >+ } >+ >+ xr_session_promise_test( >+ testName, >+ testFunction, >+ IMMERSIVE_AR_DEVICE, >+ 'immersive-ar', {'requiredFeatures': ['light-estimation']}); >+ >+ </script> >+</body> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrWebGLBinding_getReflectionCubeMap.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrWebGLBinding_getReflectionCubeMap.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b46f44881d5e852aa549c1395b70be8cc110e9b1 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/light-estimation/xrWebGLBinding_getReflectionCubeMap.https.html >@@ -0,0 +1,88 @@ >+<!DOCTYPE html> >+<body> >+ <script src=/resources/testharness.js></script> >+ <script src=/resources/testharnessreport.js></script> >+ <script src="../resources/webxr_util.js"></script> >+ <script src="../resources/webxr_test_constants.js"></script> >+ >+ <script> >+ let testName = "Test that getReflectionCubeMap returns or throws appropriately without a reflection map."; >+ >+ let testFunction = (session, controller, t, sessionObjects) => new Promise((resolve) => { >+ let debug = xr_debug.bind(this, 'testFunction'); >+ let lightProbe1 = null; >+ let binding1 = new XRWebGLBinding(session, sessionObjects.gl); >+ >+ // Request a default lightProbe >+ session.requestLightProbe({reflectionFormat: session.preferredReflectionFormat }).then((probe) => { >+ // Stash and end session. >+ lightProbe1 = probe; >+ >+ debug("Querying first pair"); >+ t.step(() => { >+ assert_equals( >+ binding1.getReflectionCubeMap(lightProbe1), >+ null, >+ "Active binding and light probe shouldn't throw when requesting cube map"); >+ }); >+ >+ return session.end(); >+ }).then(() => { >+ // Need to request a new session. >+ navigator.xr.test.simulateUserActivation( () => { >+ navigator.xr.requestSession('immersive-ar', { 'requiredFeatures': ['light-estimation'] }) >+ .then((newSession) => { >+ let newBinding = new XRWebGLBinding(newSession, sessionObjects.gl); >+ newSession.requestLightProbe({ reflectionFormat: newSession.preferredReflectionFormat }).then((newProbe) => { >+ t.step(() => { >+ debug("Querying second pair"); >+ assert_equals( >+ newBinding.getReflectionCubeMap(newProbe), >+ null, >+ "Newly created binding and light probe shouldn't throw"); >+ >+ debug("Querying old pair"); >+ assert_throws_dom( >+ "InvalidStateError", >+ () => binding1.getReflectionCubeMap(lightProbe1), >+ "Binding created with an ended session should throw InvalidStateError"); >+ debug("Querying mismatched pair"); >+ assert_throws_dom( >+ "InvalidStateError", >+ () => newBinding.getReflectionCubeMap(lightProbe1), >+ "Querying binding with a probe with a different backing session should throw InvalidStateError"); >+ }); >+ debug("losing context"); >+ >+ // Trigger a context loss and verify that we are unable to get the reflectionCubeMap. >+ let lose_context_ext = sessionObjects.gl.getExtension('WEBGL_lose_context'); >+ >+ sessionObjects.gl.canvas.addEventListener('webglcontextlost', (ev) => { >+ ev.preventDefault(); >+ >+ t.step(() => { >+ assert_throws_dom( >+ "InvalidStateError", >+ () => newBinding.getReflectionCubeMap(newProbe), >+ "Querying for reflection cube map on a binding with context loss should throw InvalidStateError"); >+ }); >+ >+ resolve(newSession.end()); >+ }); >+ >+ lose_context_ext.loseContext(); >+ }); // Request second light probe >+ }); // Request second session >+ }); // SimulateUserActivation >+ }); // .then on session end >+ }); // testFunction >+ >+ xr_session_promise_test( >+ testName, >+ testFunction, >+ IMMERSIVE_AR_DEVICE, >+ 'immersive-ar', >+ {'requiredFeatures': ['light-estimation']}); >+ >+ </script> >+</body> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/navigator_xr_sameObject.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/navigator_xr_sameObject.https-expected.txt >index 14067801428a2d7d7b1703a5d97f5d0de04a38f8..5b97ea44f0e6e95401a9948c9922a8e9b24b19c8 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/navigator_xr_sameObject.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/navigator_xr_sameObject.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS Navigator.xr meets [SameObject] requirement >+PASS Navigator.xr meets [SameObject] requirement - webgl >+FAIL Navigator.xr meets [SameObject] requirement - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/navigator_xr_sameObject.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/navigator_xr_sameObject.https.html >index 56cd65c4e42dbe7bb9d652547e65f0491e05f831..2c3ea541a97301d4dfabe93bc71c8c6d3c50b5d1 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/navigator_xr_sameObject.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/navigator_xr_sameObject.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "Navigator.xr meets [SameObject] requirement"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_update.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_update.https-expected.txt >index 410a1e8baef4e4971e856a967ffeae81a129ec60..15153bf58b0096bbf4e73c27f925286e344ae796 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_update.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_update.https-expected.txt >@@ -1,7 +1,12 @@ > >-PASS updateRenderState handles appropriately ended sessions >-PASS updateRenderState handles appropriately baseLayers created with different sessions >-PASS updateRenderState handles appropriately immersive sessions with specified inlineVerticalFieldOfView >-PASS updateRenderState handles appropriately XRRenderStateInit with no params >-PASS updateRenderState handles appropriately XRRenderStateInit params >+PASS updateRenderState handles appropriately ended sessions - webgl >+FAIL updateRenderState handles appropriately ended sessions - webgl2 assert_implements: webgl2 not supported. undefined >+PASS updateRenderState handles appropriately baseLayers created with different sessions - webgl >+FAIL updateRenderState handles appropriately baseLayers created with different sessions - webgl2 assert_implements: webgl2 not supported. undefined >+PASS updateRenderState handles appropriately immersive sessions with specified inlineVerticalFieldOfView - webgl >+FAIL updateRenderState handles appropriately immersive sessions with specified inlineVerticalFieldOfView - webgl2 assert_implements: webgl2 not supported. undefined >+PASS updateRenderState handles appropriately XRRenderStateInit with no params - webgl >+FAIL updateRenderState handles appropriately XRRenderStateInit with no params - webgl2 assert_implements: webgl2 not supported. undefined >+PASS updateRenderState handles appropriately XRRenderStateInit params - webgl >+FAIL updateRenderState handles appropriately XRRenderStateInit params - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_update.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_update.https.html >index 2f28d442ec9889ae9cf6d54b70e1c4c64b862a0f..3801a42947a792cc2e5b625dd7fc1efa9ac8da35 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_update.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_update.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas /> > > <script> > let fakeDeviceInitParams = TRACKED_IMMERSIVE_DEVICE; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_vertical_fov_immersive.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_vertical_fov_immersive.https-expected.txt >index 3de47903170d4e9aeab0d77058b3952c4d8c1767..748d321e8dc242d0e6384019b5bdb15eebf70117 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_vertical_fov_immersive.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_vertical_fov_immersive.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS inlineVerticalFieldOfView is set appropriately on immersively sessions >+PASS inlineVerticalFieldOfView is set appropriately on immersively sessions - webgl >+FAIL inlineVerticalFieldOfView is set appropriately on immersively sessions - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_vertical_fov_immersive.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_vertical_fov_immersive.https.html >index 485438cabf6a633df42a0f94c04922e7274013e1..c09cd7c174d3b338a319141f7902023d36fe87fe 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_vertical_fov_immersive.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_vertical_fov_immersive.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas /> > > <script> > let testName = "inlineVerticalFieldOfView is set appropriately on immersively sessions"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_vertical_fov_inline.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_vertical_fov_inline.https.html >index 8bf384f4f150b0b2e841b33d67e290011694c0f4..3b33fb15c31ef472d90e5a751b31ef1e27f6081b 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_vertical_fov_inline.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_vertical_fov_inline.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas /> > > <script> > let testName = "inlineVerticalFieldOfView is set appropriately on inline sessions"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/w3c-import.log >index 78f149e2cd5bb46daa173c03aae4befbb768c35c..f177152359bd703a191c9333970745297c406c1b 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/w3c-import.log >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/w3c-import.log >@@ -18,5 +18,6 @@ List of files: > /LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_math_utils.js > /LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_asserts.js > /LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants.js >+/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants_fake_depth.js > /LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants_fake_world.js > /LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_util.js >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_math_utils.js b/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_math_utils.js >index bb55fb72978690427aac38b84d1eac24e838d0eb..54a61c185469c1c4472a72f5816e6fe05562af83 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_math_utils.js >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_math_utils.js >@@ -17,6 +17,12 @@ let normalize_quaternion = function(input) { > return {x : input.x / length, y : input.y / length, z : input.z / length, w : input.w / length}; > } > >+// Returns negated quaternion. >+// |input| - point-like dict (must have x, y, z, w) >+let flip_quaternion = function(input) { >+ return {x : -input.x, y : -input.y, z : -input.z, w : -input.w}; >+} >+ > // |input| - point-like dict (must have x, y, z, w) > let conjugate_quaternion = function(input) { > return {x : -input.x, y : -input.y, z : -input.z, w : input.w}; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_asserts.js b/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_asserts.js >index 38f1364ce03ce96890cda97dcc226b8e472dd332..a82f7aaf90aabb8a49b9f10aa0d50ba795d798fe 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_asserts.js >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_asserts.js >@@ -1,8 +1,22 @@ > // Utility assert functions. > // Relies on resources/testharness.js to be included before this file. > // Relies on webxr_test_constants.js to be included before this file. >+// Relies on webxr_math_utils.js to be included before this file. > >-// |p1|, |p2| - objects with x, y, z, w components that are floating point numbers >+ >+// |p1|, |p2| - objects with x, y, z, w components that are floating point numbers. >+// Returns the name of mismatching component between p1 and p2. >+const get_mismatched_component = function(p1, p2, epsilon = FLOAT_EPSILON) { >+ for (const v of ['x', 'y', 'z', 'w']) { >+ if (Math.abs(p1[v] - p2[v]) > epsilon) { >+ return v; >+ } >+ } >+ >+ return null; >+} >+ >+// |p1|, |p2| - objects with x, y, z, w components that are floating point numbers. > // |epsilon| - float specifying precision > // |prefix| - string used as a prefix for logging > const assert_point_approx_equals = function(p1, p2, epsilon = FLOAT_EPSILON, prefix = "") { >@@ -13,13 +27,7 @@ const assert_point_approx_equals = function(p1, p2, epsilon = FLOAT_EPSILON, pre > assert_not_equals(p1, null, prefix + "p1 must be non-null"); > assert_not_equals(p2, null, prefix + "p2 must be non-null"); > >- let mismatched_component = null; >- for (const v of ['x', 'y', 'z', 'w']) { >- if (Math.abs(p1[v] - p2[v]) > epsilon) { >- mismatched_component = v; >- break; >- } >- } >+ const mismatched_component = get_mismatched_component(p1, p2, epsilon); > > if (mismatched_component !== null) { > let error_message = prefix + ' Point comparison failed.\n'; >@@ -30,7 +38,31 @@ const assert_point_approx_equals = function(p1, p2, epsilon = FLOAT_EPSILON, pre > } > }; > >-// |p1|, |p2| - objects with x, y, z, w components that are floating point numbers >+const assert_orientation_approx_equals = function(q1, q2, epsilon = FLOAT_EPSILON, prefix = "") { >+ if (q1 == null && q2 == null) { >+ return; >+ } >+ >+ assert_not_equals(q1, null, prefix + "q1 must be non-null"); >+ assert_not_equals(q2, null, prefix + "q2 must be non-null"); >+ >+ const q2_flipped = flip_quaternion(q2); >+ >+ const mismatched_component = get_mismatched_component(q1, q2, epsilon); >+ const mismatched_component_flipped = get_mismatched_component(q1, q2_flipped, epsilon); >+ >+ if (mismatched_component !== null && mismatched_component_flipped !== null) { >+ // q1 doesn't match neither q2 nor -q2, so it definitely does not represent the same orientations, >+ // log an assert failure. >+ let error_message = prefix + ' Orientation comparison failed.\n'; >+ error_message += ` p1: {x: ${q1.x}, y: ${q1.y}, z: ${q1.z}, w: ${q1.w}}\n`; >+ error_message += ` p2: {x: ${q2.x}, y: ${q2.y}, z: ${q2.z}, w: ${q2.w}}\n`; >+ error_message += ` Difference in component ${mismatched_component} exceeded the given epsilon.\n`; >+ assert_approx_equals(q2[mismatched_component], q1[mismatched_component], epsilon, error_message); >+ } >+} >+ >+// |p1|, |p2| - objects with x, y, z, w components that are floating point numbers. > // |epsilon| - float specifying precision > // |prefix| - string used as a prefix for logging > const assert_point_significantly_not_equals = function(p1, p2, epsilon = FLOAT_EPSILON, prefix = "") { >@@ -38,13 +70,7 @@ const assert_point_significantly_not_equals = function(p1, p2, epsilon = FLOAT_E > assert_not_equals(p1, null, prefix + "p1 must be non-null"); > assert_not_equals(p2, null, prefix + "p2 must be non-null"); > >- let mismatched_component = null; >- for (const v of ['x', 'y', 'z', 'w']) { >- if (Math.abs(p1[v] - p2[v]) > epsilon) { >- mismatched_component = v; >- break; >- } >- } >+ let mismatched_component = get_mismatched_component(p1, p2, epsilon); > > if (mismatched_component === null) { > let error_message = prefix + ' Point comparison failed.\n'; >@@ -67,7 +93,7 @@ const assert_transform_approx_equals = function(t1, t2, epsilon = FLOAT_EPSILON, > assert_not_equals(t2, null, prefix + "t2 must be non-null"); > > assert_point_approx_equals(t1.position, t2.position, epsilon, prefix + "positions must be equal"); >- assert_point_approx_equals(t1.orientation, t2.orientation, epsilon, prefix + "orientations must be equal"); >+ assert_orientation_approx_equals(t1.orientation, t2.orientation, epsilon, prefix + "orientations must be equal"); > }; > > // |m1|, |m2| - arrays of floating point numbers >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants.js b/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants.js >index 139ab775684c427e39bc50719226c96fcbd3a5d5..7dbedd92419d14c212573e1b10c305c2034aea9a 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants.js >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants.js >@@ -125,6 +125,7 @@ const ALL_FEATURES = [ > 'dom-overlay', > 'light-estimation', > 'anchors', >+ 'depth-sensing', > ]; > > const TRACKED_IMMERSIVE_DEVICE = { >@@ -132,7 +133,9 @@ const TRACKED_IMMERSIVE_DEVICE = { > supportedModes: [ "inline", "immersive-vr"], > views: VALID_VIEWS, > viewerOrigin: IDENTITY_TRANSFORM, >- supportedFeatures: ALL_FEATURES >+ supportedFeatures: ALL_FEATURES, >+ environmentBlendMode: "opaque", >+ interactionMode: "world-space" > }; > > const IMMERSIVE_AR_DEVICE = { >@@ -140,7 +143,9 @@ const IMMERSIVE_AR_DEVICE = { > supportedModes: [ "inline", "immersive-ar"], > views: VALID_VIEWS, > viewerOrigin: IDENTITY_TRANSFORM, >- supportedFeatures: ALL_FEATURES >+ supportedFeatures: ALL_FEATURES, >+ environmentBlendMode: "additive", >+ interactionMode: "screen-space" > }; > > const VALID_NON_IMMERSIVE_DEVICE = { >@@ -148,7 +153,9 @@ const VALID_NON_IMMERSIVE_DEVICE = { > supportedModes: ["inline"], > views: NON_IMMERSIVE_VIEWS, > viewerOrigin: IDENTITY_TRANSFORM, >- supportedFeatures: ALL_FEATURES >+ supportedFeatures: ALL_FEATURES, >+ environmentBlendMode: "opaque", >+ interactionMode: "screen-space" > }; > > const VALID_CONTROLLER = { >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants_fake_depth.js b/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants_fake_depth.js >new file mode 100644 >index 0000000000000000000000000000000000000000..36890d398ded9915ee502b0d2f1ba2fcb388b60d >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants_fake_depth.js >@@ -0,0 +1,78 @@ >+'use strict'; >+ >+// This file introduces constants used to mock depth data for depth sensing API. >+ >+const convertDepthBufferToArrayBuffer = function (data, desiredFormat) { >+ if(desiredFormat == "luminance-alpha") { >+ const result = new ArrayBuffer(data.length * 2); // each entry has 2 bytes >+ const view = new Uint16Array(result); >+ >+ for(let i = 0; i < data.length; ++i) { >+ view[i] = data[i]; >+ } >+ >+ return new Uint8Array(result); >+ } else if(desiredFormat == "float32") { >+ const result = new ArrayBuffer(data.length * 4); // each entry has 4 bytes >+ const view = new Float32Array(result); >+ >+ for(let i = 0; i < data.length; ++i) { >+ view[i] = data[i]; >+ } >+ >+ return new Uint8Array(result); >+ } else { >+ throw new Error("Unrecognized data format!"); >+ } >+} >+ >+// Let's assume that the depth values are in cm, Xcm = x * 1/100m >+const RAW_VALUE_TO_METERS = 1/100; >+ >+const createDepthSensingData = function() { >+ const depthSensingBufferHeight = 5; >+ const depthSensingBufferWidth = 7; >+ const depthSensingBuffer = [ >+ 1, 1, 1, 1, 1, 1, 1, // first row >+ 1, 2, 3, 4, 5, 6, 7, >+ 1, 4, 9, 16, 25, 36, 49, >+ 1, 8, 27, 64, 125, 216, 343, >+ 1, 16, 81, 256, 625, 1296, 2401, >+ ]; // depthSensingBuffer value at column c, row r is Math.pow(c+1, r). >+ >+ // Let's assume that the origin of the depth buffer is in the bottom right >+ // corner, with X's growing to the left and Y's growing upwards. >+ // This corresponds to the origin at 2401 in the above matrix, with X axis >+ // growing from 2401 towards 1296, and Y axis growing from 2401 towards 343. >+ // This corresponds to a rotation around Z axis by 180 degrees, with origin at [1,1]. >+ const depthSensingBufferFromViewerTransform = { >+ position: [1, 1, 0], >+ orientation: [0, 0, 1, 0], >+ }; >+ >+ return { >+ depthData: convertDepthBufferToArrayBuffer(depthSensingBuffer, "luminance-alpha"), >+ width: depthSensingBufferWidth, >+ height: depthSensingBufferHeight, >+ normDepthBufferFromNormView: depthSensingBufferFromViewerTransform, >+ rawValueToMeters: RAW_VALUE_TO_METERS, >+ }; >+}; >+ >+const DEPTH_SENSING_DATA = createDepthSensingData(); >+ >+// Returns expected depth value at |column|, |row| coordinates, expressed >+// in depth buffer's coordinate system. >+const getExpectedValueAt = function(column, row) { >+ return Math.pow(column+1, row) * RAW_VALUE_TO_METERS; >+}; >+ >+const VALID_DEPTH_CONFIG_CPU_USAGE = { >+ usagePreference: ['cpu-optimized'], >+ dataFormatPreference: ['luminance-alpha', 'float32'], >+}; >+ >+const VALID_DEPTH_CONFIG_GPU_USAGE = { >+ usagePreference: ['gpu-optimized'], >+ dataFormatPreference: ['luminance-alpha', 'float32'], >+}; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_util.js b/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_util.js >index a987ca1f4420c16b3e55620115d536a635ae3695..75d73968ccaaca1411391f25b2726f6bda57e27d 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_util.js >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_util.js >@@ -13,11 +13,17 @@ > // override this. > var xr_debug = function(name, msg) {}; > >-function xr_promise_test(name, func, properties) { >+function xr_promise_test(name, func, properties, glContextType, glContextProperties) { > promise_test(async (t) => { >+ if (glContextType === 'webgl2') { >+ // Fast fail on platforms not supporting WebGL2. >+ assert_implements('WebGL2RenderingContext' in window, 'webgl2 not supported.'); >+ } > // Perform any required test setup: > xr_debug(name, 'setup'); > >+ assert_implements(navigator.xr, 'missing navigator.xr - ensure test is run in a secure context.'); >+ > // Only set up once. > if (!navigator.xr.test) { > // Load test-only API helpers. >@@ -37,8 +43,6 @@ function xr_promise_test(name, func, properties) { > } else if (isWebKitBased) { > // WebKit setup > await setupWebKitWebXRTestAPI(); >- } else { >- assert_implements(false, "missing navigator.xr.test"); > } > } > >@@ -47,10 +51,14 @@ function xr_promise_test(name, func, properties) { > // setup properly. Either way, the fact that xr_promise_test is being used > // means that the tests expect navigator.xr.test to be set. By rejecting now > // we can hopefully provide a clearer indication of what went wrong. >- if (!navigator.xr.test) { >- // We can't use assert_true here because it causes the wpt testharness >- // to treat this as a test page and not as a test. >- return Promise.reject("No navigator.xr.test object found, even after attempted load"); >+ assert_implements(navigator.xr.test, 'missing navigator.xr.test, even after attempted load'); >+ >+ let gl = null; >+ let canvas = null; >+ if (glContextType) { >+ canvas = document.createElement('canvas'); >+ document.body.appendChild(canvas); >+ gl = canvas.getContext(glContextType, glContextProperties); > } > > // Ensure that any devices are disconnected when done. If this were done in >@@ -64,7 +72,7 @@ function xr_promise_test(name, func, properties) { > }); > > xr_debug(name, 'main'); >- return func(t); >+ return func(t, gl); > }, name, properties); > } > >@@ -83,80 +91,85 @@ function requestSkipAnimationFrame(session, callback) { > // A test function which runs through the common steps of requesting a session. > // Calls the passed in test function with the session, the controller for the > // device, and the test object. >-// Requires a webglCanvas on the page. > function xr_session_promise_test( >- name, func, fakeDeviceInit, sessionMode, sessionInit, properties, glcontextPropertiesParam, gllayerPropertiesParam) { >- let testDeviceController; >- let testSession; >- let sessionObjects = {}; >+ name, func, fakeDeviceInit, sessionMode, sessionInit, properties, >+ glcontextPropertiesParam, gllayerPropertiesParam) { > const glcontextProperties = (glcontextPropertiesParam) ? glcontextPropertiesParam : {}; > const gllayerProperties = (gllayerPropertiesParam) ? gllayerPropertiesParam : {}; > >- const webglCanvas = document.getElementsByTagName('canvas')[0]; >- // We can't use assert_true here because it causes the wpt testharness to treat >- // this as a test page and not as a test. >- if (!webglCanvas) { >- promise_test(async (t) => { >- Promise.reject('xr_session_promise_test requires a canvas on the page!'); >- }, name, properties); >+ function runTest(t, glContext) { >+ let testSession; >+ let testDeviceController; >+ let sessionObjects = {gl: glContext}; >+ >+ // Ensure that any pending sessions are ended when done. This needs to >+ // use a cleanup function to ensure proper sequencing. If this were >+ // done in a .then() for the success case, a test that expected >+ // failure would already be marked done at the time that runs, and the >+ // shutdown would interfere with the next test which may have started. >+ t.add_cleanup(async () => { >+ // If a session was created, end it. >+ if (testSession) { >+ await testSession.end().catch(() => {}); >+ } >+ }); >+ >+ return navigator.xr.test.simulateDeviceConnection(fakeDeviceInit) >+ .then((controller) => { >+ testDeviceController = controller; >+ return sessionObjects.gl.makeXRCompatible(); >+ }) >+ .then(() => new Promise((resolve, reject) => { >+ // Perform the session request in a user gesture. >+ xr_debug(name, 'simulateUserActivation'); >+ navigator.xr.test.simulateUserActivation(() => { >+ xr_debug(name, 'document.hasFocus()=' + document.hasFocus()); >+ navigator.xr.requestSession(sessionMode, sessionInit || {}) >+ .then((session) => { >+ xr_debug(name, 'session start'); >+ testSession = session; >+ session.mode = sessionMode; >+ let glLayer = new XRWebGLLayer(session, sessionObjects.gl, gllayerProperties); >+ glLayer.context = sessionObjects.gl; >+ // Session must have a baseLayer or frame requests >+ // will be ignored. >+ session.updateRenderState({ >+ baseLayer: glLayer >+ }); >+ sessionObjects.glLayer = glLayer; >+ xr_debug(name, 'session.visibilityState=' + session.visibilityState); >+ try { >+ resolve(func(session, testDeviceController, t, sessionObjects)); >+ } catch(err) { >+ reject("Test function failed with: " + err); >+ } >+ }) >+ .catch((err) => { >+ xr_debug(name, 'error: ' + err); >+ reject( >+ 'Session with params ' + >+ JSON.stringify(sessionMode) + >+ ' was rejected on device ' + >+ JSON.stringify(fakeDeviceInit) + >+ ' with error: ' + err); >+ }); >+ }); >+ })); > } >- let gl = webglCanvas.getContext('webgl', {alpha: false, antialias: false, ...glcontextProperties}); >- sessionObjects.gl = gl; > > xr_promise_test( >- name, >- (t) => { >- // Ensure that any pending sessions are ended when done. This needs to >- // use a cleanup function to ensure proper sequencing. If this were >- // done in a .then() for the success case, a test that expected >- // failure would already be marked done at the time that runs, and the >- // shutdown would interfere with the next test which may have started. >- t.add_cleanup(async () => { >- // If a session was created, end it. >- if (testSession) { >- await testSession.end().catch(() => {}); >- } >- }); >- >- return navigator.xr.test.simulateDeviceConnection(fakeDeviceInit) >- .then((controller) => { >- testDeviceController = controller; >- return gl.makeXRCompatible(); >- }) >- .then(() => new Promise((resolve, reject) => { >- // Perform the session request in a user gesture. >- xr_debug(name, 'simulateUserActivation'); >- navigator.xr.test.simulateUserActivation(() => { >- xr_debug(name, 'document.hasFocus()=' + document.hasFocus()); >- navigator.xr.requestSession(sessionMode, sessionInit || {}) >- .then((session) => { >- xr_debug(name, 'session start'); >- testSession = session; >- session.mode = sessionMode; >- let glLayer = new XRWebGLLayer(session, gl, gllayerProperties); >- glLayer.context = gl; >- // Session must have a baseLayer or frame requests >- // will be ignored. >- session.updateRenderState({ >- baseLayer: glLayer >- }); >- sessionObjects.glLayer = glLayer; >- xr_debug(name, 'session.visibilityState=' + session.visibilityState); >- resolve(func(session, testDeviceController, t, sessionObjects)); >- }) >- .catch((err) => { >- xr_debug(name, 'error: ' + err); >- reject( >- 'Session with params ' + >- JSON.stringify(sessionMode) + >- ' was rejected on device ' + >- JSON.stringify(fakeDeviceInit) + >- ' with error: ' + err); >- }); >- }); >- })); >- }, >- properties); >+ name + ' - webgl', >+ runTest, >+ properties, >+ 'webgl', >+ {alpha: false, antialias: false, ...glcontextProperties} >+ ); >+ xr_promise_test( >+ name + ' - webgl2', >+ runTest, >+ properties, >+ 'webgl2', >+ {alpha: false, antialias: false, ...glcontextProperties}); > } > > >@@ -200,40 +213,21 @@ function forEachWebxrObject(callback) { > > // Code for loading test API in Chromium. > async function loadChromiumResources() { >- let chromiumResources = [ >- '/gen/mojo/public/mojom/base/time.mojom.js', >- '/gen/mojo/public/mojom/base/shared_memory.mojom.js', >- '/gen/mojo/public/mojom/base/unguessable_token.mojom.js', >- '/gen/gpu/ipc/common/sync_token.mojom.js', >- '/gen/gpu/ipc/common/mailbox.mojom.js', >- '/gen/gpu/ipc/common/mailbox_holder.mojom.js', >- '/gen/ui/gfx/geometry/mojom/geometry.mojom.js', >- '/gen/ui/gfx/mojom/native_handle_types.mojom.js', >- '/gen/ui/gfx/mojom/buffer_types.mojom.js', >- '/gen/ui/gfx/mojom/color_space.mojom.js', >- '/gen/ui/gfx/mojom/display_color_spaces.mojom.js', >- '/gen/ui/gfx/mojom/gpu_fence_handle.mojom.js', >- '/gen/ui/gfx/mojom/transform.mojom.js', >- '/gen/ui/display/mojom/display.mojom.js', >- '/gen/device/gamepad/public/mojom/gamepad.mojom.js', >- '/gen/device/vr/public/mojom/vr_service.mojom.js', >- '/resources/chromium/webxr-test-math-helper.js', >- '/resources/chromium/webxr-test.js', >- // Required only by resources/chromium/webxr-test.js >- '/resources/testdriver.js', >- '/resources/testdriver-vendor.js', >- ]; >+ await loadScript('/resources/chromium/webxr-test-math-helper.js'); >+ await import('/resources/chromium/webxr-test.js'); >+ await loadScript('/resources/testdriver.js'); >+ await loadScript('/resources/testdriver-vendor.js'); > > // This infrastructure is also used by Chromium-specific internal tests that > // may need additional resources (e.g. internal API extensions), this allows > // those tests to rely on this infrastructure while ensuring that no tests > // make it into public WPTs that rely on APIs outside of the webxr test API. > if (typeof(additionalChromiumResources) !== 'undefined') { >- chromiumResources = chromiumResources.concat(additionalChromiumResources); >+ for (const path of additionalChromiumResources) { >+ await loadScript(path); >+ } > } > >- await loadMojoResources(chromiumResources); >- > xr_debug = navigator.xr.test.Debug; > } > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/webxr/w3c-import.log >index ecaa8229e6bc09a53b80ae619d67e557366ca05a..4d2eaf57216fedf59b2e4a252e45ba329afedf0b 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/w3c-import.log >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/w3c-import.log >@@ -52,6 +52,7 @@ List of files: > /LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_requiredFeatures_unknown.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getPose.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getViewerPose_getPose.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getViewerPose_getPose_identities.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_lifetime.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_session_sameObject.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_add_remove.https.html >@@ -79,6 +80,7 @@ List of files: > /LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace_features.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestSessionDuringEnd.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_sameObject.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_viewer_availability.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_viewer_referenceSpace.https.html >@@ -97,3 +99,4 @@ List of files: > /LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer_stencil.https.html > /LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_viewports.https.html >+/LayoutTests/imported/w3c/web-platform-tests/webxr/xr_viewport_scale.https.html >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https-expected.txt >index bdd27f077da7b49e6b677ed24b0af4f0522cd0f9..4f1af2a116bf21cd06669bd2e24b7f9a0a52c808 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https-expected.txt >@@ -1,3 +1,6 @@ > >-PASS An XR-compatible webglCanvasContext can be created >+PASS Creating a webgl context with no device >+FAIL Creating a webgl2 context with no device assert_implements: webgl2 not supported. undefined >+FAIL An XR-compatible webgl context can be created promise_test: Unhandled rejection with value: object "InvalidStateError: The object is in an invalid state." >+FAIL An XR-compatible webgl2 context can be created assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https.html >index 10131b329625fff87be1d7d10ca27e2267296f65..3cdbce99ccd140abe6911e0e3afce6e35382f211 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https.html >@@ -4,28 +4,49 @@ > <script src=/resources/testharnessreport.js></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >- <canvas id="webgl-canvas"></canvas> > <script> >- xr_promise_test("An XR-compatible webglCanvasContext can be created", >- (t) => { >- let gl = null; >- let offscreenGl = null; >- return navigator.xr.test.simulateDeviceConnection(TRACKED_IMMERSIVE_DEVICE) >- .then( (controller) => { >- let webglCanvas = document.getElementById('webgl-canvas'); >- gl = webglCanvas.getContext('webgl'); >- return gl.makeXRCompatible(); >- }).then( () => { >- assert_true(gl.getContextAttributes().xrCompatible); >- >- // Check that an offscreen context behaves no different. >- //let offscreenCanvas = document.createElement('canvas'); >- //offscreenGl = offscreenCanvas.getContext('webgl'); >- //return offscreenGl.makeXRCompatible(); >- }).then( () => { >- //assert_true(offscreenGl.getContextAttributes().xrCompatible); >- }); >+ >+ function testNoDevice(t, gl) { >+ assert_false(gl.getContextAttributes().xrCompatible); >+ return promise_rejects_dom(t, "InvalidStateError", gl.makeXRCompatible()); >+ } >+ >+ xr_promise_test("Creating a webgl context with no device", >+ testNoDevice, null, 'webgl'); >+ >+ xr_promise_test("Creating a webgl2 context with no device", >+ testNoDevice, null, 'webgl2'); >+ >+ function testOffscreenCanvas(canvas, glContextType) { >+ let gl = canvas.getContext('webgl'); >+ >+ return gl.makeXRCompatible().then(() => { >+ assert_true(gl.getContextAttributes().xrCompatible); > }); >+ } >+ >+ function testXrCompatible(t, gl) { >+ return navigator.xr.test.simulateDeviceConnection(TRACKED_IMMERSIVE_DEVICE) >+ .then( (controller) => { >+ return gl.makeXRCompatible(); >+ }).then( () => { >+ assert_true(gl.getContextAttributes().xrCompatible); >+ >+ return testOffscreenCanvas(document.createElement('canvas'), 'webgl'); >+ }).then( () => { >+ return testOffscreenCanvas(document.createElement('canvas'), 'webgl2'); >+ }).then( () => { >+ return testOffscreenCanvas(new OffscreenCanvas(1, 1), 'webgl'); >+ }).then( () => { >+ return testOffscreenCanvas(new OffscreenCanvas(1, 1), 'webgl2'); >+ }); >+ } >+ >+ xr_promise_test("An XR-compatible webgl context can be created", >+ testXrCompatible, null, 'webgl'); >+ >+ xr_promise_test("An XR-compatible webgl2 context can be created", >+ testXrCompatible, null, 'webgl2'); > > </script> > </body> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https-expected.txt >index 27bb09623908a664becff289cac41e7252e8b294..b410d9399f7ff502df621d9bf3418ca7638f1005 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS A lost webglCanvasContext should not be able to set xr compatibility >+PASS A lost webgl context should not be able to set xr compatibility >+FAIL A lost webgl2 context should not be able to set xr compatibility assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https.html >index 0e59807cb4c2999b5287cee56a117294b06b569f..354c61479277d4dbb8f200b53938597b5a58252f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https.html >@@ -4,22 +4,25 @@ > <script src=/resources/testharnessreport.js></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >- <canvas id="webgl-canvas"></canvas> > <script> > >- xr_promise_test( >- "A lost webglCanvasContext should not be able to set xr compatibility", >- (t) => { >+ function testContextLost(t, gl) { > return navigator.xr.test.simulateDeviceConnection(TRACKED_IMMERSIVE_DEVICE) > .then( (controller) => { >- webglCanvas = document.getElementById('webgl-canvas'); >- gl = webglCanvas.getContext('webgl'); > return gl.makeXRCompatible(); > }).then( () => { > gl.getExtension('WEBGL_lose_context').loseContext(); > return promise_rejects_dom(t, 'InvalidStateError', gl.makeXRCompatible()); > }); >- }); >+ } >+ >+ xr_promise_test( >+ "A lost webgl context should not be able to set xr compatibility", >+ testContextLost, null, 'webgl'); >+ >+ xr_promise_test( >+ "A lost webgl2 context should not be able to set xr compatibility", >+ testContextLost, null, 'webgl2'); > > </script> > </body> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https-expected.txt >index 439a0d9d6c3eb9b0965345a177ca53d83116b6ca..028a88a5689bb19b995a06454d1e3ed8e8c786b1 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https-expected.txt >@@ -1,4 +1,6 @@ > >-PASS Verify promise from a non-reentrant to makeXRCompatible() is resolved >-PASS Verify promises from reentrant calls to makeXRCompatible() are resolved >+PASS Verify promise from a non-reentrant call to makeXRCompatible() is resolved for webgl >+FAIL Verify promise from a non-reentrant call to makeXRCompatible() is resolved for webgl2 assert_implements: webgl2 not supported. undefined >+PASS Verify promises from reentrant calls to makeXRCompatible() are resolved for webgl >+FAIL Verify promises from reentrant calls to makeXRCompatible() are resolved for webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html >index f412c6fb2e00caae8eafe6407038acd26d592dd4..f54a878d45d08fd74f8d4341ad8d70e16c79a8ca 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html >@@ -5,11 +5,8 @@ > <script src="resources/webxr_util.js"></script> > <script> > >-xr_promise_test( >- "Verify promise from a non-reentrant to makeXRCompatible() is resolved", >- (t) => { >- var gl = document.createElement('canvas').getContext('webgl'); >- return navigator.xr.test.simulateDeviceConnection(TRACKED_IMMERSIVE_DEVICE) >+function testNonReentrant(t, gl) { >+ return navigator.xr.test.simulateDeviceConnection(TRACKED_IMMERSIVE_DEVICE) > .then((controller) => { > assert_false(gl.getContextAttributes().xrCompatible); > return gl.makeXRCompatible(); >@@ -19,13 +16,17 @@ xr_promise_test( > }).then(() => { > assert_true(gl.getContextAttributes().xrCompatible); > }); >- }); >+} > > xr_promise_test( >- "Verify promises from reentrant calls to makeXRCompatible() are resolved", >- (t) => { >- var gl = document.createElement('canvas').getContext('webgl'); >- return navigator.xr.test.simulateDeviceConnection(TRACKED_IMMERSIVE_DEVICE) >+ "Verify promise from a non-reentrant call to makeXRCompatible() is resolved for webgl", >+ testNonReentrant, null, 'webgl'); >+xr_promise_test( >+ "Verify promise from a non-reentrant call to makeXRCompatible() is resolved for webgl2", >+ testNonReentrant, null, 'webgl2'); >+ >+function testReentrant(t, gl) { >+ return navigator.xr.test.simulateDeviceConnection(TRACKED_IMMERSIVE_DEVICE) > .then((controller) => { > assert_false(gl.getContextAttributes().xrCompatible); > >@@ -35,6 +36,13 @@ xr_promise_test( > }).then(() => { > assert_true(gl.getContextAttributes().xrCompatible); > }); >- }); >+} >+ >+xr_promise_test( >+ "Verify promises from reentrant calls to makeXRCompatible() are resolved for webgl", >+ testReentrant, null, 'webgl'); >+xr_promise_test( >+ "Verify promises from reentrant calls to makeXRCompatible() are resolved for webgl2", >+ testReentrant, null, 'webgl2'); > > </script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/webxr_feature_policy.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/webxr_feature_policy.https.html >index 7f3d03b48e5881d74d92d187243814dc9fa58b7d..b493ec73cce687832cfc0784a1a798d665eb10af 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/webxr_feature_policy.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/webxr_feature_policy.https.html >@@ -78,4 +78,20 @@ xr_promise_test( > }); > > }); >+ >+xr_promise_test( >+"Validate xr compatibility requests without xr-spatial-tracking policy", >+(t) => { >+ let canvas = document.createElement('canvas'); >+ let gl = canvas.getContext('webgl', {xrCompatible: true}); >+ >+ t.step(() => { >+ assert_false(gl.getContextAttributes().xrCompatible, >+ "xrCompatibility shouldn't be set when requested without feature policy"); >+ }); >+ >+ return promise_rejects_dom(t, "SecurityError", >+ gl.makeXRCompatible(), >+ "makeXRCompatible should reject without feature policy"); >+}); > </script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrBoundedReferenceSpace_updates.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrBoundedReferenceSpace_updates.https-expected.txt >index 29101dda105e8d07f93a79ba2c6a3bd2cc5fe01e..1fc42201ec4199b4c1030daf21ed3c8fa39b65c0 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrBoundedReferenceSpace_updates.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrBoundedReferenceSpace_updates.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS 'XRBoundedReferenceSpace updates properly when the changes are applied >+PASS 'XRBoundedReferenceSpace updates properly when the changes are applied - webgl >+FAIL 'XRBoundedReferenceSpace updates properly when the changes are applied - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrBoundedReferenceSpace_updates.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrBoundedReferenceSpace_updates.https.html >index 3d5040436657d7b09b290562f1cfde086b924495..c5f9b7f325a8203ea44d6ab863fd9263f08111bf 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrBoundedReferenceSpace_updates.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrBoundedReferenceSpace_updates.https.html >@@ -4,7 +4,6 @@ > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> > <script src="resources/webxr_test_asserts.js"></script> >-<canvas></canvas> > > <script> > let testName = >@@ -27,7 +26,7 @@ let testFunction = function(session, fakeDeviceController, t) { > t.step(() => { > // A bounded space may be created if no bounds have been set but the system has the capability to support bounded-floor > // A lack of bounds is indicated by an empty boundsGeometry >- assert_true(referenceSpace.boundsGeometry.length == 0); >+ assert_equals(referenceSpace.boundsGeometry.length, 0); > }); > > function onFrame(time, xrFrame) { >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_disconnect_ends.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_disconnect_ends.https.html >index ace64e8f41212d2e21a450ef6958bf2b7508a0da..644a4d68e4336b9b5532046a7f8e454483a36bb6 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_disconnect_ends.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_disconnect_ends.https.html >@@ -4,7 +4,6 @@ > <script src=/resources/testharnessreport.js></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >- <canvas></canvas> > > <script> > const testName = "Immersive session ends when device is disconnected"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_immersive.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_immersive.https-expected.txt >index 746dc4a68b53a983724d7422eb965738bb81bfc0..db87980224cef7d7745400a5d68e5d5a0a5c25e6 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_immersive.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_immersive.https-expected.txt >@@ -1,5 +1,8 @@ > >-PASS Tests requestSession resolves when supported >-PASS Tests requestSession accepts XRSessionInit dictionary >-PASS Tests requestSession ignores unknown optionalFeatures >+PASS Tests requestSession resolves when supported - webgl >+FAIL Tests requestSession resolves when supported - webgl2 assert_implements: webgl2 not supported. undefined >+PASS Tests requestSession accepts XRSessionInit dictionary - webgl >+FAIL Tests requestSession accepts XRSessionInit dictionary - webgl2 assert_implements: webgl2 not supported. undefined >+PASS Tests requestSession ignores unknown optionalFeatures - webgl >+FAIL Tests requestSession ignores unknown optionalFeatures - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_immersive.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_immersive.https.html >index be0bb32995b86ee576c1e55414d7f7d81a1e0fc1..6ff88216708f62d22fba5ee9e1c860e6adf4642f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_immersive.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_immersive.https.html >@@ -4,7 +4,6 @@ > <script src=/resources/testharnessreport.js></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >- <canvas></canvas> > <script> > xr_session_promise_test( > "Tests requestSession resolves when supported", >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_optionalFeatures.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_optionalFeatures.https-expected.txt >index c4b22e48271c90cdb396b26ce0d4aee1a594e896..39cb2e20ed0dac2d2733b6c0d78a69730abb1a7c 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_optionalFeatures.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_optionalFeatures.https-expected.txt >@@ -1,6 +1,10 @@ > >-PASS Tests requestSession accepts XRSessionInit dictionary >-PASS Tests requestSession accepts XRSessionInit dictionary with empty feature lists >-PASS Tests requestSession ignores unknown strings in optionalFeatures >-PASS Tests requestSession ignores unknown objects in optionalFeatures >+PASS Tests requestSession accepts XRSessionInit dictionary - webgl >+FAIL Tests requestSession accepts XRSessionInit dictionary - webgl2 assert_implements: webgl2 not supported. undefined >+PASS Tests requestSession accepts XRSessionInit dictionary with empty feature lists - webgl >+FAIL Tests requestSession accepts XRSessionInit dictionary with empty feature lists - webgl2 assert_implements: webgl2 not supported. undefined >+PASS Tests requestSession ignores unknown strings in optionalFeatures - webgl >+FAIL Tests requestSession ignores unknown strings in optionalFeatures - webgl2 assert_implements: webgl2 not supported. undefined >+PASS Tests requestSession ignores unknown objects in optionalFeatures - webgl >+FAIL Tests requestSession ignores unknown objects in optionalFeatures - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_optionalFeatures.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_optionalFeatures.https.html >index 0071b81e828603c3765edc1fea3ff659b3e39452..f7737624a6ff48dcb03a9e8c307e61f7ee0f8f46 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_optionalFeatures.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_optionalFeatures.https.html >@@ -4,7 +4,6 @@ > <script src=/resources/testharnessreport.js></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >- <canvas></canvas> > <script> > xr_session_promise_test( > "Tests requestSession accepts XRSessionInit dictionary", >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_requiredFeatures_unknown.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_requiredFeatures_unknown.https-expected.txt >index 6a3a3a5661f12dd0fe3567dd48fae9d3374987e0..95cae577b948984020dd9fa407ae4b4aea1eb2e1 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_requiredFeatures_unknown.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_requiredFeatures_unknown.https-expected.txt >@@ -1,3 +1,3 @@ > >-PASS Tests requestSession rejects for unknown requiredFeatures >+FAIL Tests requestSession rejects for unknown requiredFeatures promise_rejects_dom: unexpected requestSession success with unknown object function "function () { throw e }" threw object "SecurityError: The operation is insecure." that is not a DOMException NotSupportedError: property "code" is equal to 18, expected 9 > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getPose.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getPose.https-expected.txt >index 49623d4f8a17f85ff827cc58e85833504f966928..9b0f263351d0efe98c85c46c0bdde9f48e8b8245 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getPose.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getPose.https-expected.txt >@@ -1,4 +1,6 @@ > >-PASS XRFrame.getPose works for immersive sessions >-PASS XRFrame.getPose works for non-immersive sessions >+PASS XRFrame.getPose works for immersive sessions - webgl >+FAIL XRFrame.getPose works for immersive sessions - webgl2 assert_implements: webgl2 not supported. undefined >+PASS XRFrame.getPose works for non-immersive sessions - webgl >+FAIL XRFrame.getPose works for non-immersive sessions - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getPose.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getPose.https.html >index 1f3e3765df4e0a4319ea94842f2368e673948c4c..9cd7922f64f7d8be8c37b86d4b7f829283a4fed4 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getPose.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getPose.https.html >@@ -4,7 +4,6 @@ > <script src="resources/webxr_test_constants.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_asserts.js"></script> >-<canvas></canvas> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getViewerPose_getPose.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getViewerPose_getPose.https-expected.txt >index b61be3901378d90605bb263d61bfbe8bdaf20e0e..792ab4fe2d4170c4b8a22ad683ad06d660e25373 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getViewerPose_getPose.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getViewerPose_getPose.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRFrame getViewerPose(refSpace) matches getPose(viewer, refSpace). >+PASS XRFrame getViewerPose(refSpace) matches getPose(viewer, refSpace). - webgl >+FAIL XRFrame getViewerPose(refSpace) matches getPose(viewer, refSpace). - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getViewerPose_getPose.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getViewerPose_getPose.https.html >index 7d26983fc963c3ef4b00726d055f6b1a85d2d5f9..05cbf785237b7c7d2177976ea16b31a4060e3a1f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getViewerPose_getPose.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getViewerPose_getPose.https.html >@@ -5,7 +5,6 @@ > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> > <script src="resources/webxr_test_asserts.js"></script> >- <canvas></canvas> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getViewerPose_getPose_identities.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getViewerPose_getPose_identities.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..ba2269147e4cd8bfaca58756d8b47f6c7a354f9a >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_getViewerPose_getPose_identities.https.html >@@ -0,0 +1,113 @@ >+<!DOCTYPE html> >+<body> >+ <script src=/resources/testharness.js></script> >+ <script src=/resources/testharnessreport.js></script> >+ <script src="resources/webxr_util.js"></script> >+ <script src="resources/webxr_test_constants.js"></script> >+ <script src="resources/webxr_test_asserts.js"></script> >+ >+ <script> >+ >+ let testName = "XRFrame getViewerPose(viewerSpace) & getPose(space, space) return identity even during tracking loss"; >+ >+ // Use the same device as tracked immersive device, but modify the viewer origin. >+ const deviceInitParams = Object.assign({}, TRACKED_IMMERSIVE_DEVICE, {viewerOrigin: null}); >+ >+ // Used when creating a reference space that is offset from local space. >+ // Actual values should not matter for the test. >+ const offsetSpaceTransform = new XRRigidTransform( >+ { x: 1.00, y: -1.50, z: 10.00, w: 1.0 }, >+ { x: 0.27, y: 0.00, z: 0.27, w: 0.92}, // 45 degrees around [1, 0, 1] axis >+ ); >+ >+ const expectMatrix = function(pose, expectedMatrix, poseName) { >+ assert_not_equals(pose, null, >+ poseName + " should not be null!"); >+ assert_matrix_approx_equals(pose.transform.matrix, expectedMatrix, >+ poseName + "'s matrix should match expectations!"); >+ assert_false(pose.emulatedPosition, >+ poseName + ".emulatedPosition should be false!"); >+ } >+ >+ const expectIdentity = function(pose, poseName) { >+ assert_not_equals(pose, null, >+ poseName + " should not be null!"); >+ assert_matrix_approx_equals(pose.transform.matrix, IDENTITY_MATRIX, >+ poseName + "'s matrix should equal identity!"); >+ assert_false(pose.emulatedPosition, >+ poseName + ".emulatedPosition should be false!"); >+ } >+ >+ const testFunction = function(session, fakeDeviceController, t) { >+ return Promise.all([ >+ session.requestReferenceSpace('local'), >+ session.requestReferenceSpace('viewer'), >+ session.requestReferenceSpace('local-floor'), >+ session.requestReferenceSpace('bounded-floor'), >+ session.requestReferenceSpace('unbounded'), >+ session.requestReferenceSpace('local'), >+ ]).then((allSpaces) => new Promise((resolve, reject) => { >+ const [ >+ localSpace1, >+ viewerSpace, >+ localFloorSpace, >+ boundedFloorSpace, >+ unboundedSpace, >+ localSpace2] = allSpaces; >+ >+ const offsetLocalSpace1 = localSpace1.getOffsetReferenceSpace(offsetSpaceTransform); >+ const offsetLocalSpace2 = localSpace2.getOffsetReferenceSpace(offsetSpaceTransform); >+ const offsetViewerSpace = viewerSpace.getOffsetReferenceSpace(offsetSpaceTransform); >+ >+ // Throw in an offset space: >+ allSpaces.push(offsetLocalSpace1); >+ >+ function onFrame(time, frame) { >+ // Expect identities: >+ const viewerFromViewer1 = frame.getViewerPose(viewerSpace); >+ >+ const localFromLocalDifferentAddress = frame.getPose(localSpace1, localSpace2); >+ const offsetFromOffsetDifferentAddress = frame.getPose(offsetLocalSpace1, offsetLocalSpace2); >+ >+ t.step(() => { >+ expectIdentity(viewerFromViewer1, "viewerFromViewer1"); >+ expectIdentity(localFromLocalDifferentAddress, "localFromLocalDifferentAddress"); >+ expectIdentity(offsetFromOffsetDifferentAddress, "offsetFromOffsetDifferentAddress"); >+ }); >+ >+ // Expect offsetSpaceTransform: >+ const viewerFromViewer2 = frame.getViewerPose(offsetViewerSpace); >+ >+ const viewerFromOffset2 = frame.getPose(offsetViewerSpace, viewerSpace); >+ const localFromOffset1 = frame.getPose(offsetLocalSpace1, localSpace1); >+ const localFromOffset2 = frame.getPose(offsetLocalSpace2, localSpace1); >+ >+ t.step(() => { >+ expectMatrix(viewerFromViewer2, offsetSpaceTransform.matrix, "viewerFromViewer2"); >+ expectMatrix(viewerFromOffset2, offsetSpaceTransform.matrix, "viewerFromOffset2"); >+ expectMatrix(localFromOffset1, offsetSpaceTransform.matrix, "localFromOffset1"); >+ expectMatrix(localFromOffset2, offsetSpaceTransform.matrix, "localFromOffset2"); >+ }); >+ >+ // Expect identities: >+ allSpaces.forEach((space, index) => { >+ const pose = frame.getPose(space, space); >+ t.step(() => { >+ expectIdentity(pose, "pose[" + index +"]"); >+ }); >+ }); >+ >+ resolve(); >+ } >+ >+ session.requestAnimationFrame(onFrame); >+ })); >+ }; >+ >+ xr_session_promise_test(testName, testFunction, >+ deviceInitParams, 'immersive-vr', { >+ requiredFeatures: ["local", "local-floor", "bounded-floor", "unbounded"] >+ }); >+ >+ </script> >+</body> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_lifetime.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_lifetime.https.html >index 7c71f0af3dda960bb4c723e4cd8a1267db45a3e6..e457ef020fd81a77070541c77f7680c99485c556 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_lifetime.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_lifetime.https.html >@@ -4,7 +4,6 @@ > <script src=/resources/testharnessreport.js></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >- <canvas></canvas> > > <script> > let immersiveTestName = "XRFrame methods throw exceptions outside of the " + >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_session_sameObject.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_session_sameObject.https-expected.txt >index 38a36983c79a2bbc671ca05cdafabbab6745ee72..1e2d3fe345237630bdd4f872f0986da4cfbfc849 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_session_sameObject.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_session_sameObject.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRFrame.session meets [SameObject] requirement >+PASS XRFrame.session meets [SameObject] requirement - webgl >+FAIL XRFrame.session meets [SameObject] requirement - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_session_sameObject.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_session_sameObject.https.html >index cbbef68713b2991945827899407036a8a9205a14..d1d4beb16473fd123d24205c20fc5ade4a4c5cd0 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_session_sameObject.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrFrame_session_sameObject.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "XRFrame.session meets [SameObject] requirement"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_add_remove.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_add_remove.https-expected.txt >index d4b564bf857d53de7c832c3d25b40e213f9a2448..9b778785e4e153406b35cc805e38552f13d26294 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_add_remove.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_add_remove.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRInputSources can be properly added and removed from the session >+PASS XRInputSources can be properly added and removed from the session - webgl >+FAIL XRInputSources can be properly added and removed from the session - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_add_remove.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_add_remove.https.html >index 7764017910d2e5ada78febe954e9543aca89226b..00253311982cb1bb8841894633323ccd2cb56e38 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_add_remove.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_add_remove.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_emulatedPosition.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_emulatedPosition.https-expected.txt >index 4aa707f6ce44ef648f44f0dac695e27dc0f5656d..3871432d8f4fbabb782c2851afbd066caca94885 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_emulatedPosition.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_emulatedPosition.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS Poses from XRInputSource.gripSpace have emulatedPosition set properly >+PASS Poses from XRInputSource.gripSpace have emulatedPosition set properly - webgl >+FAIL Poses from XRInputSource.gripSpace have emulatedPosition set properly - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_emulatedPosition.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_emulatedPosition.https.html >index 2bc21ffe6c395de22a1aa840cb8a97e44a81eebe..8a4aec48a84b35383c3b3fae885c2a470e3d7b71 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_emulatedPosition.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_emulatedPosition.https.html >@@ -4,7 +4,6 @@ > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> > <script src="resources/webxr_test_asserts.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_profiles.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_profiles.https-expected.txt >index 8d176ed76e199cea774bd12b9f8e9f0f43b44df1..a9a762178ae0a0e34dc217c9262432fbd7d4c48f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_profiles.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_profiles.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS WebXR InputSource's profiles list can be set >+PASS WebXR InputSource's profiles list can be set - webgl >+FAIL WebXR InputSource's profiles list can be set - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_profiles.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_profiles.https.html >index f55e682b67528c0e01406163490fa433a69d0592..de70c9058fee58e893085b962d6d591c9342ddf8 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_profiles.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_profiles.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "WebXR InputSource's profiles list can be set"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_sameObject.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_sameObject.https-expected.txt >index e8b20bcf5ebd0eee3862d0c59c73009c824bf345..f06235fa92509fb05db7c8fd093954c49bf8c1de 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_sameObject.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_sameObject.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRInputSource attributes meet [SameObject] requirement >+PASS XRInputSource attributes meet [SameObject] requirement - webgl >+FAIL XRInputSource attributes meet [SameObject] requirement - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_sameObject.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_sameObject.https.html >index 305e5f9e0fccc8ef7a7d96d9e65da130b5f54239..999b4d82b6fa2abf10c76ff28fb5beb5f0c23e87 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_sameObject.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_sameObject.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "XRInputSource attributes meet [SameObject] requirement"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrPose_transform_sameObject.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrPose_transform_sameObject.https.html >index 8e2239cff167cbb88b8702c4f3f413d447b5015e..9ea07fcd3bf223df7aa8b7e5959a6721e43d17b5 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrPose_transform_sameObject.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrPose_transform_sameObject.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "XRPose.transform meets [SameObject] requirement"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset.https-expected.txt >index ec34cfc2cc7659eb4fb0a31c095848cc32bad247..66fbfb94eefd1fdd34aad0d35e02c5452228659a 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS Updating XRReferenceSpace origin offset updates view and input matrices. >+PASS Updating XRReferenceSpace origin offset updates view and input matrices. - webgl >+FAIL Updating XRReferenceSpace origin offset updates view and input matrices. - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset.https.html >index f6929f27af0ee73676c09be7de25afa2ed3d1fd4..d93f696a2dafa5e92bb55a14c65d74bc0216bb56 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset.https.html >@@ -4,7 +4,6 @@ > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> > <script src="resources/webxr_test_asserts.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "Updating XRReferenceSpace origin offset updates view and input matrices."; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffsetBounded.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffsetBounded.https.html >index 7ce4acafd35ef7ccad553cdf15ebd43a0e24d6c7..fd961735ec756fc07fecc2481d293c4924a5fe80 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffsetBounded.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffsetBounded.https.html >@@ -4,7 +4,6 @@ > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> > <script src="resources/webxr_test_asserts.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > >@@ -67,10 +66,9 @@ function testFunction(session, fakeDeviceController, t) { > }); > > return new Promise((resolve, reject) => { >- requestSkipAnimationFrame(session, (time, frame) => { >- let input_source = session.inputSources[0]; >- >- session.requestReferenceSpace('bounded-floor').then((referenceSpace) => { >+ session.requestReferenceSpace('bounded-floor').then((referenceSpace) => { >+ requestSkipAnimationFrame(session, (time, frame) => { >+ let input_source = session.inputSources[0]; > > function CheckState( > reference_space, >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset_viewer.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset_viewer.https-expected.txt >index 6df9f2ba6a5819f04f10cf57bbcc9f5506955ffa..434e67835304a763d2054c11fbc3ab3439d12c18 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset_viewer.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset_viewer.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS Creating XRReferenceSpace origin offset off of `viewer` space works. >+PASS Creating XRReferenceSpace origin offset off of `viewer` space works. - webgl >+FAIL Creating XRReferenceSpace origin offset off of `viewer` space works. - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset_viewer.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset_viewer.https.html >index 5cd0f027266eee2a341e5b5d062227d2013ee67b..8a9fb344a385a3dea05774f9308f420a6d9923bf 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset_viewer.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset_viewer.https.html >@@ -4,7 +4,6 @@ > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> > <script src="resources/webxr_test_asserts.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "Creating XRReferenceSpace origin offset off of `viewer` space works."; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_relationships.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_relationships.https-expected.txt >index c1ecc1b2bef82f61ab1b4aaef8ab1910366bcdd6..050369f462394230ea5839baf85346ec7e51efb1 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_relationships.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_relationships.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS Bounded space, viewer space, local and local-floor space have correct poses w.r.t. each other >+PASS Bounded space, viewer space, local and local-floor space have correct poses w.r.t. each other - webgl >+FAIL Bounded space, viewer space, local and local-floor space have correct poses w.r.t. each other - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_relationships.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_relationships.https.html >index f97ca6639f7c991fa81ba6bab4560ad932270fbd..5b680fb86182f9343da05b1842b77e182ae748a4 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_relationships.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_relationships.https.html >@@ -5,7 +5,6 @@ > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> > <script src="resources/webxr_test_asserts.js"></script> >-<canvas></canvas> > <script> > let testName = > "Bounded space, viewer space, local and local-floor space have correct poses w.r.t. each other"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_constructor.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_constructor.https-expected.txt >index f0c4caf6da8ff99ce73dc39a78f3f5d405844731..8a0929f8501543c386d0a1b80414358b58a6d480 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_constructor.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_constructor.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRRigidTransform constructor works >+PASS XRRigidTransform constructor works - webgl >+FAIL XRRigidTransform constructor works - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_constructor.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_constructor.https.html >index 5e055efc41b74fc968b097610e8deba38f2642df..fbea1c1ccb3f7c6d9e09b900624f07ddee327730 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_constructor.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_constructor.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > <script> > > let testName = "XRRigidTransform constructor works"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_inverse.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_inverse.https-expected.txt >index f47d23f4a662cd9e218f78b65129f46cdc722084..8e9dca5dd7d773c95a139d6d2733faa049975344 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_inverse.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_inverse.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRRigidTransform inverse works >+PASS XRRigidTransform inverse works - webgl >+FAIL XRRigidTransform inverse works - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_inverse.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_inverse.https.html >index 3098fb64936349e58aa6a919a8ec97d6334e5e02..d4fdc15396d25223ab07d473a0039434b4c58761 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_inverse.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_inverse.https.html >@@ -2,9 +2,9 @@ > <script src="/resources/testharness.js"></script> > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> >+<script src="resources/webxr_math_utils.js"></script> > <script src="resources/webxr_test_constants.js"></script> > <script src="resources/webxr_test_asserts.js"></script> >-<canvas id="webgl-canvas"></canvas> > <script> > > let testName = "XRRigidTransform inverse works"; >@@ -93,10 +93,10 @@ let testFunction = > { x: 0.0, y: 0.0, z: 1.0, w: 1.0 }); > inverse_transform = transform.inverse; > t.step(() => { >- assert_true(transform.inverse === inverse_transform); >- assert_true(inverse_transform.inverse === transform); >- assert_true(transform.inverse.inverse === transform); >- assert_true(transform.inverse.inverse.inverse === inverse_transform); >+ assert_equals(transform.inverse, inverse_transform); >+ assert_equals(inverse_transform.inverse, transform); >+ assert_equals(transform.inverse.inverse, transform); >+ assert_equals(transform.inverse.inverse.inverse, inverse_transform); > }); > > resolve(); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_sameObject.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_sameObject.https-expected.txt >index 9a5e71893d19b07ba712a17951f0eb83be0df9b9..3f44f4f3414600e8e68d6849b8a2d7aa647cf9cd 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_sameObject.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_sameObject.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRRigidTransform position and orientation meet [SameObject] requirements >+PASS XRRigidTransform position and orientation meet [SameObject] requirements - webgl >+FAIL XRRigidTransform position and orientation meet [SameObject] requirements - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_sameObject.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_sameObject.https.html >index 57c7ef1853ea24f9ce8f339e01ce9e929dcaf22f..8ff4f5c258b489793e89e75304a876dc28eae995 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_sameObject.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_sameObject.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > <script> > > let testName = "XRRigidTransform position and orientation meet [SameObject] requirements"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_cancelAnimationFrame.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_cancelAnimationFrame.https-expected.txt >index 34126894e773fce5ddaa23fc52f86385d9214114..50b04341152fabe32d3a5aab24ff7af74fa23959 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_cancelAnimationFrame.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_cancelAnimationFrame.https-expected.txt >@@ -1,4 +1,6 @@ > >-PASS XRSession requestAnimationFrame callbacks can be unregistered with cancelAnimationFrame for immersive sessions >-PASS XRSession requestAnimationFrame callbacks can be unregistered with cancelAnimationFrame for non-immersive sessions >+PASS XRSession requestAnimationFrame callbacks can be unregistered with cancelAnimationFrame for immersive sessions - webgl >+FAIL XRSession requestAnimationFrame callbacks can be unregistered with cancelAnimationFrame for immersive sessions - webgl2 assert_implements: webgl2 not supported. undefined >+PASS XRSession requestAnimationFrame callbacks can be unregistered with cancelAnimationFrame for non-immersive sessions - webgl >+FAIL XRSession requestAnimationFrame callbacks can be unregistered with cancelAnimationFrame for non-immersive sessions - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_cancelAnimationFrame.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_cancelAnimationFrame.https.html >index 6a294f21f06d98483d9278d08e50124d84779aad..2b3403fe461adf9d54bae468f210ea951af179c4 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_cancelAnimationFrame.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_cancelAnimationFrame.https.html >@@ -4,7 +4,6 @@ > <script src=/resources/testharnessreport.js></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >- <canvas></canvas> > > <script> > let immersiveTestName = "XRSession requestAnimationFrame callbacks can be " >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_cancelAnimationFrame_invalidhandle.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_cancelAnimationFrame_invalidhandle.https-expected.txt >index 3a88b316fba16516b325216dfce751e9fd7ba090..1cf2e4913b9fe0fadd4e89ba37189692ab630722 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_cancelAnimationFrame_invalidhandle.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_cancelAnimationFrame_invalidhandle.https-expected.txt >@@ -1,4 +1,6 @@ > >-PASS XRSession cancelAnimationFrame does not have unexpected behavior when given invalid handles on immersive testSession >-PASS XRSession cancelAnimationFrame does not have unexpected behavior when given invalid handles on non-immersive testSession >+PASS XRSession cancelAnimationFrame does not have unexpected behavior when given invalid handles on immersive testSession - webgl >+FAIL XRSession cancelAnimationFrame does not have unexpected behavior when given invalid handles on immersive testSession - webgl2 assert_implements: webgl2 not supported. undefined >+PASS XRSession cancelAnimationFrame does not have unexpected behavior when given invalid handles on non-immersive testSession - webgl >+FAIL XRSession cancelAnimationFrame does not have unexpected behavior when given invalid handles on non-immersive testSession - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_cancelAnimationFrame_invalidhandle.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_cancelAnimationFrame_invalidhandle.https.html >index 51a639b956c8f64c3f219df4fbde2e99160e9959..f036e3080fc213eb58455e7b17d91a99884f5083 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_cancelAnimationFrame_invalidhandle.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_cancelAnimationFrame_invalidhandle.https.html >@@ -4,7 +4,6 @@ > <script src=/resources/testharnessreport.js></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >- <canvas></canvas> > <script> > let immersiveTestName = "XRSession cancelAnimationFrame does not have unexpected " > + "behavior when given invalid handles on immersive testSession"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_end.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_end.https-expected.txt >index 3958188ca105f843393ed2a68ea30a079d7b76f7..2b7207c18797970fe9d6ada072d041a0dafb3247 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_end.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_end.https-expected.txt >@@ -1,4 +1,6 @@ > >-PASS end event fires when immersive session ends >-PASS end event fires when non-immersive session ends >+PASS end event fires when immersive session ends - webgl >+FAIL end event fires when immersive session ends - webgl2 assert_implements: webgl2 not supported. undefined >+PASS end event fires when non-immersive session ends - webgl >+FAIL end event fires when non-immersive session ends - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_end.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_end.https.html >index e8c078ead9b7eaf4ed4312f14945ddfa07994614..dccc550be58b2e8c99ca7220f0c33e0ea9e4f3b5 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_end.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_end.https.html >@@ -4,7 +4,6 @@ > <script src=/resources/testharnessreport.js></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >- <canvas></canvas> > > <script> > const immersivetestName = "end event fires when immersive session ends"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_input_events_end.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_input_events_end.https.html >index 636562dd6ec06c1d5d84d73b0b10ed38d7950ad5..b7f64617eefe1da28835c6d77d67b6b605778519 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_input_events_end.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_input_events_end.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "Calling end during an input callback stops processing at the right time"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_callback_calls.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_callback_calls.https-expected.txt >index dda5ae9616a392bf5ef57f75077a16f5d5b29ee9..4bfda516d65cc3c186180ae848966038b86145f6 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_callback_calls.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_callback_calls.https-expected.txt >@@ -1,4 +1,6 @@ > >-PASS XRSession requestAnimationFrame calls the provided callback for an immersive session >-PASS XRSession requestAnimationFrame calls the provided callback a non-immersive session >+PASS XRSession requestAnimationFrame calls the provided callback for an immersive session - webgl >+FAIL XRSession requestAnimationFrame calls the provided callback for an immersive session - webgl2 assert_implements: webgl2 not supported. undefined >+PASS XRSession requestAnimationFrame calls the provided callback a non-immersive session - webgl >+FAIL XRSession requestAnimationFrame calls the provided callback a non-immersive session - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_callback_calls.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_callback_calls.https.html >index 98231c8e9e70ea73a0b63785bb108362512f36e4..ee29b8794a7e5058688f7b3cb7681d19194eb1f8 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_callback_calls.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_callback_calls.https.html >@@ -4,7 +4,6 @@ > <script src=/resources/testharnessreport.js></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >- <canvas></canvas> > > <script> > let immersiveTestName = "XRSession requestAnimationFrame calls the " + >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_data_valid.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_data_valid.https-expected.txt >index 5d9f391a764f488b8f7e3182cc86e820b01f3057..44bb60287c26e426803d4c24da78f0f479489311 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_data_valid.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_data_valid.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS RequestAnimationFrame resolves with good data >+PASS RequestAnimationFrame resolves with good data - webgl >+FAIL RequestAnimationFrame resolves with good data - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_data_valid.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_data_valid.https.html >index 760ff3dd657f9c56d01f6d952879bb20dd9a0e46..812c79c1d58f8b05b08d6ad47c513d990216e696 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_data_valid.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_data_valid.https.html >@@ -4,7 +4,6 @@ > <script src=/resources/testharnessreport.js></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >- <canvas></canvas> > > <script> > const testName = "RequestAnimationFrame resolves with good data"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https-expected.txt >index b2e67dafee5c3c810ad9a29a3ed5ccd99ca570a5..06156ff8c44136177358ef0bbcba9e67ffac37e0 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https-expected.txt >@@ -1,4 +1,6 @@ > >-PASS XRFrame getViewerPose updates on the next frame for non-immersive sessions >-PASS XRFrame getViewerPose updates on the next frame for immersive sessions >+PASS XRFrame getViewerPose updates on the next frame for non-immersive sessions - webgl >+FAIL XRFrame getViewerPose updates on the next frame for non-immersive sessions - webgl2 assert_implements: webgl2 not supported. undefined >+PASS XRFrame getViewerPose updates on the next frame for immersive sessions - webgl >+FAIL XRFrame getViewerPose updates on the next frame for immersive sessions - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https.html >index 1b54f5f6ec147f8e1d3877bb28c5bb5c1ff104b6..68ad344320e04914917f7851b89262ae5c449c3b 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https.html >@@ -5,7 +5,6 @@ > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> > <script src="resources/webxr_test_asserts.js"></script> >- <canvas></canvas> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https-expected.txt >index f58a423fc6b198112935bff2907278fda94fcc56..172217277d2a62dffdaa669b5b6d2fd0f4cbc3f7 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https-expected.txt >@@ -1,4 +1,6 @@ > >-PASS XRFrame getViewerPose updates on the next frame for immersive >-PASS XRFrame getViewerPose updates on the next frame for non-immersive >+PASS XRFrame getViewerPose updates on the next frame for immersive - webgl >+FAIL XRFrame getViewerPose updates on the next frame for immersive - webgl2 assert_implements: webgl2 not supported. undefined >+PASS XRFrame getViewerPose updates on the next frame for non-immersive - webgl >+FAIL XRFrame getViewerPose updates on the next frame for non-immersive - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https.html >index 32638894470d09bb865aaf0f14607433f30badea..ee6bb49432069aba7647d269d0576ab3453660b3 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas /> > > <script> > const TEN_SECONDS = 10000; // 10k ms in ten seconds >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace.https-expected.txt >index 3e7e66e25fea59433e9e0190cad01204e319e0b5..67d3dc60c35381e263f5e64b6acd70e4f1b712ea 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace.https-expected.txt >@@ -1,4 +1,6 @@ > >-PASS Immersive XRSession requestReferenceSpace returns expected objects >-PASS Non-immersive XRSession requestReferenceSpace returns expected objects >+PASS Immersive XRSession requestReferenceSpace returns expected objects - webgl >+FAIL Immersive XRSession requestReferenceSpace returns expected objects - webgl2 assert_implements: webgl2 not supported. undefined >+PASS Non-immersive XRSession requestReferenceSpace returns expected objects - webgl >+FAIL Non-immersive XRSession requestReferenceSpace returns expected objects - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace.https.html >index b141d6d14d531649fdff091e176ed68ea7a363c2..b8765fd060f2e2bb5a08250d7b3170f312f07d85 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace.https.html >@@ -4,7 +4,6 @@ > <script src=/resources/testharnessreport.js></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >- <canvas></canvas> > <script> > > let immersiveTestName = >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace_features.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace_features.https-expected.txt >index 90e86e7f40a5e43a7d3c8f2ef0272a510b54ef01..395dcbcbafc50c2a4876c89176357db99d9f334a 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace_features.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace_features.https-expected.txt >@@ -1,14 +1,26 @@ > >-PASS Non-immersive session supports viewer space by default >-PASS Immersive session supports viewer space by default >-PASS Immersive session supports local space by default >-PASS Non-immersive session supports local space when required >-PASS Non-immersive session supports local space when optional >-PASS Non-immersive session supports local-floor space when required >-PASS Immersive session supports local-floor space when required >-PASS Immersive session supports local-floor space when optional >-PASS Non-immersive session rejects bounded-floor space even when requested >-PASS Non-immersive session rejects unbounded space even when requested >-PASS Non-immersive session rejects local space if not requested >-PASS Immersive session rejects local-floor space if not requested >+PASS Non-immersive session supports viewer space by default - webgl >+FAIL Non-immersive session supports viewer space by default - webgl2 assert_implements: webgl2 not supported. undefined >+PASS Immersive session supports viewer space by default - webgl >+FAIL Immersive session supports viewer space by default - webgl2 assert_implements: webgl2 not supported. undefined >+PASS Immersive session supports local space by default - webgl >+FAIL Immersive session supports local space by default - webgl2 assert_implements: webgl2 not supported. undefined >+PASS Non-immersive session supports local space when required - webgl >+FAIL Non-immersive session supports local space when required - webgl2 assert_implements: webgl2 not supported. undefined >+PASS Non-immersive session supports local space when optional - webgl >+FAIL Non-immersive session supports local space when optional - webgl2 assert_implements: webgl2 not supported. undefined >+PASS Non-immersive session supports local-floor space when required - webgl >+FAIL Non-immersive session supports local-floor space when required - webgl2 assert_implements: webgl2 not supported. undefined >+PASS Immersive session supports local-floor space when required - webgl >+FAIL Immersive session supports local-floor space when required - webgl2 assert_implements: webgl2 not supported. undefined >+PASS Immersive session supports local-floor space when optional - webgl >+FAIL Immersive session supports local-floor space when optional - webgl2 assert_implements: webgl2 not supported. undefined >+FAIL Non-immersive session rejects bounded-floor space even when requested - webgl promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'sessionObjects.gl.makeXRCompatible')" >+FAIL Non-immersive session rejects bounded-floor space even when requested - webgl2 assert_implements: webgl2 not supported. undefined >+FAIL Non-immersive session rejects unbounded space even when requested - webgl promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'sessionObjects.gl.makeXRCompatible')" >+FAIL Non-immersive session rejects unbounded space even when requested - webgl2 assert_implements: webgl2 not supported. undefined >+FAIL Non-immersive session rejects local space if not requested - webgl promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'sessionObjects.gl.makeXRCompatible')" >+FAIL Non-immersive session rejects local space if not requested - webgl2 assert_implements: webgl2 not supported. undefined >+FAIL Immersive session rejects local-floor space if not requested - webgl promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'sessionObjects.gl.makeXRCompatible')" >+FAIL Immersive session rejects local-floor space if not requested - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace_features.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace_features.https.html >index bdfd8c79cfae840038f642235eecc1be46a173cd..a20223fca3b1ae2d04441b83680107a3de45675a 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace_features.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace_features.https.html >@@ -4,7 +4,6 @@ > <script src=/resources/testharnessreport.js></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >- <canvas></canvas> > <script> > > let makeSpaceTest = (space_type) => { >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestSessionDuringEnd.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestSessionDuringEnd.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..38133b616ad560711f4806990455d915c5baf95b >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestSessionDuringEnd.https.html >@@ -0,0 +1,68 @@ >+<!DOCTYPE html> >+<body> >+ <script src=/resources/testharness.js></script> >+ <script src=/resources/testharnessreport.js></script> >+ <script src="resources/webxr_util.js"></script> >+ <script src="resources/webxr_test_constants.js"></script> >+ >+ <script> >+ function testFunctionGenerator(createSessionFromEventCallback) { >+ return function(session, testDeviceController, t) { >+ let done = false; >+ >+ function createSession() { >+ return new Promise((resolve) => { >+ navigator.xr.requestSession("immersive-vr") >+ .then((new_session) => { >+ // The test framework ensures that the created session ends, >+ // but will not do cleanup for this session, so if it gets >+ // created, we need to ensure that it gets cleaned up. >+ return new_session.end(); >+ }).then(() => { >+ done = true; >+ resolve(); >+ }).catch((err) => { >+ // Only one catch is needed for the whole promise chain. >+ // If ending the new session throws, it's fine to fail as >+ // we'd otherwise end up in a bad state. >+ t.step(() => { >+ assert_unreached("Session creation should not throw: " + err); >+ }); >+ }); >+ }); >+ } >+ >+ function onSessionEnd() { >+ if (createSessionFromEventCallback) { >+ createSession(); >+ } >+ } >+ >+ session.addEventListener("end", onSessionEnd, false); >+ >+ // We need to simulate the user activation before we call end as >+ // otherwise (depending on the implementation) it can interfere with >+ // the scheduling of the dispatched event/promise, and make session >+ // creation succeed even when there may be bugs preventing it from >+ // doing so in real scenarios. >+ navigator.xr.test.simulateUserActivation(() => { >+ session.end().then(() => { >+ if (!createSessionFromEventCallback) { >+ createSession(); >+ } >+ }); >+ }); >+ >+ return t.step_wait(() => done); >+ }; >+ } >+ >+ xr_session_promise_test("Create new session in OnSessionEnded event", >+ testFunctionGenerator(/*createSessionFromEventCallback=*/true), >+ TRACKED_IMMERSIVE_DEVICE, 'immersive-vr'); >+ >+ xr_session_promise_test("Create mew session in end promise", >+ testFunctionGenerator(/*createSessionFromEventCallback=*/false), >+ TRACKED_IMMERSIVE_DEVICE, 'immersive-vr'); >+ </script> >+</body> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_sameObject.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_sameObject.https-expected.txt >index de4df93dc0ee6d40de657922cd9de2192602938e..48c65216476253edda5d90ee1e903a700a4b2e60 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_sameObject.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_sameObject.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRSession attributes meet [SameObject] requirement >+PASS XRSession attributes meet [SameObject] requirement - webgl >+FAIL XRSession attributes meet [SameObject] requirement - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_sameObject.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_sameObject.https.html >index 66aeef81c50c36ff2fc50dcc7c45749f25605893..1795ee7a727d775e2a0655ffad1a073d9cb3d656 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_sameObject.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_sameObject.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "XRSession attributes meet [SameObject] requirement"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_viewer_referenceSpace.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_viewer_referenceSpace.https-expected.txt >index 3b5621a4e1b3681bc4de2457d79cbf5bed2c8811..4b661b25e0655eda6bba8ac37c82380d876fc1f7 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_viewer_referenceSpace.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_viewer_referenceSpace.https-expected.txt >@@ -1,4 +1,6 @@ > >-PASS Identity reference space provides correct poses for inline sessions >-PASS Identity reference space provides correct poses for immersive sessions >+PASS Identity reference space provides correct poses for inline sessions - webgl >+FAIL Identity reference space provides correct poses for inline sessions - webgl2 assert_implements: webgl2 not supported. undefined >+PASS Identity reference space provides correct poses for immersive sessions - webgl >+FAIL Identity reference space provides correct poses for immersive sessions - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_viewer_referenceSpace.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_viewer_referenceSpace.https.html >index fd6082bc3468f094953152d220fceafa083baf76..0098d4d918daf26342c8672c7e6699e2824581e3 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_viewer_referenceSpace.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_viewer_referenceSpace.https.html >@@ -4,7 +4,6 @@ > <script src=/resources/testharnessreport.js></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >- <canvas></canvas> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_visibilityState.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_visibilityState.https.html >index 2311792d0fd0e748bed709bfc90682682d44d9fd..12655f4be0bbb7604e68f8c906572c73b258b26a 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_visibilityState.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_visibilityState.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "Ensures that the XRSession's visibilityState is correctly " >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrStationaryReferenceSpace_floorlevel_updates.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrStationaryReferenceSpace_floorlevel_updates.https.html >index 967291609c0f05a9e457e3ffa2a77f601fa9d461..f1e907d6bbe6ebb86f27aa79b47bcd13e06f5022 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrStationaryReferenceSpace_floorlevel_updates.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrStationaryReferenceSpace_floorlevel_updates.https.html >@@ -4,7 +4,6 @@ > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> > <script src="resources/webxr_test_asserts.js"></script> >-<canvas></canvas> > > <script> > let immersiveTestName = "'floor-level' XRStationaryReferenceSpace updates properly when " + >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_eyes.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_eyes.https-expected.txt >index 4cdac2de12a10c669bcb5983aa302da59bb69f9e..28a56dccafa1f4158858db24ac530b93e0c1224b 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_eyes.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_eyes.https-expected.txt >@@ -1,4 +1,6 @@ > >-PASS XRView.eye is correct for immersive sessions >-PASS XRView.eye is correct for non-immersive sessions >+PASS XRView.eye is correct for immersive sessions - webgl >+FAIL XRView.eye is correct for immersive sessions - webgl2 assert_implements: webgl2 not supported. undefined >+PASS XRView.eye is correct for non-immersive sessions - webgl >+FAIL XRView.eye is correct for non-immersive sessions - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_eyes.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_eyes.https.html >index 956edba98365d90eb180ad3c9697dae098bd25db..ac017cd80098334db482f2ad212e297df656251d 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_eyes.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_eyes.https.html >@@ -4,7 +4,6 @@ > <script src="resources/webxr_test_constants.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_asserts.js"></script> >-<canvas></canvas> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_match.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_match.https-expected.txt >index 113f6bc9e65ec6f134613b9e2b1f471bca359405..7968bdef513ac8aa7fd6892cbd45908b5988579f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_match.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_match.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRFrame contains the expected views >+PASS XRFrame contains the expected views - webgl >+FAIL XRFrame contains the expected views - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_match.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_match.https.html >index 4bb48826ae02d995e6d8763c04cefe64f7057274..2ef430734d6c894ea5e538d605de54fc70404e9a 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_match.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_match.https.html >@@ -4,7 +4,6 @@ > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> > <script src="resources/webxr_test_asserts.js"></script> >-<canvas /> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_oneframeupdate.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_oneframeupdate.https-expected.txt >index ce022158f0b5dac7331fc6e587a0090d3f58bd60..e1835dc3f999a72a74706313ed054e344dfa464d 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_oneframeupdate.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_oneframeupdate.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRView projection matrices update near and far depths on the next frame >+PASS XRView projection matrices update near and far depths on the next frame - webgl >+FAIL XRView projection matrices update near and far depths on the next frame - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_oneframeupdate.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_oneframeupdate.https.html >index 6671721e4c54059373e7a031132dddb41237094c..6c50f6f0c9d0225128f0cb328fe9a9277f45a9af 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_oneframeupdate.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_oneframeupdate.https.html >@@ -4,7 +4,6 @@ > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> > <script src="resources/webxr_test_asserts.js"></script> >-<canvas /> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_sameObject.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_sameObject.https-expected.txt >index e9f50cb8a6c878ee81d66da943a24a0e3f198e66..fb06ac7c6e3fab5ecb608282f964e0197550acee 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_sameObject.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_sameObject.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRView attributes meet [SameObject] requirement >+PASS XRView attributes meet [SameObject] requirement - webgl >+FAIL XRView attributes meet [SameObject] requirement - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_sameObject.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_sameObject.https.html >index 1213bcb1f1166a876ecb7e0d76260092525e3cd6..2defa722060c4f277688e404432b462b18bd2c2f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_sameObject.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrView_sameObject.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "XRView attributes meet [SameObject] requirement"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrViewerPose_views_sameObject.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrViewerPose_views_sameObject.https-expected.txt >index f154e8d1dcec54815cd38b0e0c8d0520565a6c4c..b6948c4896ebe0ac8b851a77dd20cfe401e2f463 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrViewerPose_views_sameObject.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrViewerPose_views_sameObject.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRViewerPose.views meets [SameObject] requirement >+PASS XRViewerPose.views meets [SameObject] requirement - webgl >+FAIL XRViewerPose.views meets [SameObject] requirement - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrViewerPose_views_sameObject.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrViewerPose_views_sameObject.https.html >index ec1ee6964f0ddcfc93e1be13ff0b4d09a2af59ec..af64111d8242d954acf29c123834833f12b16e96 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrViewerPose_views_sameObject.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrViewerPose_views_sameObject.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas id="webgl-canvas"></canvas> > > <script> > let testName = "XRViewerPose.views meets [SameObject] requirement"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrViewport_valid.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrViewport_valid.https-expected.txt >index a9a6eb72ad575341b5dd503e2d6c64a3be524c42..9492d1e640f1192e0759eae9baf9be16f1b46dfd 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrViewport_valid.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrViewport_valid.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRViewport attributes are valid >+PASS XRViewport attributes are valid - webgl >+FAIL XRViewport attributes are valid - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrViewport_valid.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrViewport_valid.https.html >index 1b7d982d596187f1381bee73eac2990900a37f8f..4588a3fbc2bda8739b286509a931907c256b3e7c 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrViewport_valid.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrViewport_valid.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas /> > > <script> > let testName = "XRViewport attributes are valid"; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_constructor.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_constructor.https-expected.txt >index cd51474ab0a309f53a2b57e7a849d972d1176437..9cf0b30d62b4708542a7cb106f7a636ca697a8f0 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_constructor.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_constructor.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS Ensure that XRWebGLLayer's constructor throws appropriate errors >+PASS Ensure that XRWebGLLayer's constructor throws appropriate errors using webgl >+FAIL Ensure that XRWebGLLayer's constructor throws appropriate errors using webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_constructor.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_constructor.https.html >index e5b2335c2351ebda7aec3466a1583f1202e6e447..5796e1e0ef32d95b38a7cac5169c87320a17ee9e 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_constructor.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_constructor.https.html >@@ -3,18 +3,10 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas /> > > <script> >-xr_promise_test("Ensure that XRWebGLLayer's constructor throws appropriate errors", >- (t) => { >- let webglCanvas = document.getElementsByTagName('canvas')[0]; >- let glAttributes = { >- alpha: false, >- antialias: false, >- xrCompatible: false, >- }; >- let gl = webglCanvas.getContext('webgl', glAttributes); >+ >+function testConstructor(t, gl) { > return navigator.xr.test.simulateDeviceConnection(TRACKED_IMMERSIVE_DEVICE) > .then(() => { > return navigator.xr.requestSession('inline') >@@ -52,7 +44,7 @@ xr_promise_test("Ensure that XRWebGLLayer's constructor throws appropriate error > > let lose_context_ext = gl.getExtension('WEBGL_lose_context'); > >- webglCanvas.addEventListener('webglcontextlost', (ev) => { >+ gl.canvas.addEventListener('webglcontextlost', (ev) => { > ev.preventDefault(); > > try { >@@ -64,7 +56,7 @@ xr_promise_test("Ensure that XRWebGLLayer's constructor throws appropriate error > } > }); > >- webglCanvas.addEventListener('webglcontextrestored', (ev) => { >+ gl.canvas.addEventListener('webglcontextrestored', (ev) => { > resolve(xrSession.end().then(() => { > try { > let webglLayerBadSession = new XRWebGLLayer(xrSession, gl); >@@ -80,6 +72,11 @@ xr_promise_test("Ensure that XRWebGLLayer's constructor throws appropriate error > }); > }); > }); >-}); >+} >+xr_promise_test("Ensure that XRWebGLLayer's constructor throws appropriate errors using webgl", >+ testConstructor, null, 'webgl'); >+ >+xr_promise_test("Ensure that XRWebGLLayer's constructor throws appropriate errors using webgl2", >+ testConstructor, null, 'webgl2'); > > </script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_draw.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_draw.https-expected.txt >index 0f09dc9fdc2233ad4357bbb399a63a1aad003945..1523ad5f468efeaa148af3b678f27aa55429aca9 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_draw.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_draw.https-expected.txt >@@ -3,5 +3,6 @@ CONSOLE MESSAGE: WebGL: INVALID_FRAMEBUFFER_OPERATION: clear: An opaque framebuf > CONSOLE MESSAGE: WebGL: INVALID_FRAMEBUFFER_OPERATION: drawArrays: An opaque framebuffer is considered incomplete outside of a requestAnimationFrame > CONSOLE MESSAGE: WebGL: INVALID_FRAMEBUFFER_OPERATION: drawElements: An opaque framebuffer is considered incomplete outside of a requestAnimationFrame > >-PASS Ensure a WebGL layer's framebuffer can only be drawn to inside a XR frame >+PASS Ensure a WebGL layer's framebuffer can only be drawn to inside a XR frame - webgl >+FAIL Ensure a WebGL layer's framebuffer can only be drawn to inside a XR frame - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_draw.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_draw.https.html >index dd40865e445aafce88f5941f4127236c36f01f2d..eb797cf93ae9e671e92f93f7758c2c4d835132a1 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_draw.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_draw.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas /> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_sameObject.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_sameObject.https-expected.txt >index eabdc2b6fce732256b6f08c2a421459560e8b42f..f83f8d36361c2d8f8259b27cccb589dd3397f6cb 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_sameObject.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_sameObject.https-expected.txt >@@ -1,3 +1,4 @@ > >-PASS XRWebGLLayer.framebuffer meets [SameObject] requirement >+PASS XRWebGLLayer.framebuffer meets [SameObject] requirement - webgl >+FAIL XRWebGLLayer.framebuffer meets [SameObject] requirement - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_sameObject.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_sameObject.https.html >index b0f637863b6aec46d36d3d1400219ce7aebb494a..75efc626d69e7d2d46366191f18112ccbc56f4f8 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_sameObject.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_sameObject.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas /> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_scale.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_scale.https.html >index 7b5cedb1c83987daf435f662e5687cf6e1bb0559..065fc3df4e4b6f0e4ac0ab5683daa3ad67223abf 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_scale.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_framebuffer_scale.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas /> > > <script> > >@@ -26,7 +25,7 @@ let testFunction = > assert_greater_than(nativeScale, 0); > > // The native scale should be the inverse for the default framebuffer scale. >- assert_approx_equals(nativeScale, 1/fakeDeviceController.displayInfo_.webxrDefaultFramebufferScale, FLOAT_EPSILON); >+ assert_approx_equals(nativeScale, 1/fakeDeviceController.defaultFramebufferScale_, FLOAT_EPSILON); > }); > > webglLayer = new XRWebGLLayer(session, gl, { framebufferScaleFactor: nativeScale }); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer.https-expected.txt >index c5cc76f5d96c7e90725f567e2c347e9fd0adcf10..d7b49d97a8c58393d3feebaea65a518a53a020cb 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer.https-expected.txt >@@ -16,6 +16,8 @@ CONSOLE MESSAGE: WebGL: INVALID_OPERATION: framebufferRenderbuffer: An opaque fr > CONSOLE MESSAGE: WebGL: INVALID_OPERATION: framebufferRenderbuffer: An opaque framebuffer's attachments cannot be inspected or changed > CONSOLE MESSAGE: WebGL: checkFramebufferStatus:An opaque framebuffer is considered incomplete outside of a requestAnimationFrame > >-PASS Ensure that the framebuffer given by the WebGL layer is opaque for immersive >-PASS Ensure that the framebuffer given by the WebGL layer is opaque for non-immersive >+PASS Ensure that the framebuffer given by the WebGL layer is opaque for immersive - webgl >+FAIL Ensure that the framebuffer given by the WebGL layer is opaque for immersive - webgl2 assert_implements: webgl2 not supported. undefined >+PASS Ensure that the framebuffer given by the WebGL layer is opaque for non-immersive - webgl >+FAIL Ensure that the framebuffer given by the WebGL layer is opaque for non-immersive - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer.https.html >index 4d27a9155e6a63e70a4a0f22e16c51f10214d796..f0d63de501545f3626e3af10fab6994b662e7baa 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas /> > > <script> > let immersiveTestName = "Ensure that the framebuffer given by the WebGL layer" + >@@ -49,25 +48,29 @@ let testFunction = > assert_equals(xrFramebuffer, boundFramebuffer); > assert_equals(gl.getError(), gl.NO_ERROR); > >- // Ensure the framebuffer attachment properties cannot be inspected. >- let attachments = [ >- gl.COLOR_ATTACHMENT0, >- gl.DEPTH_ATTACHMENT, >- gl.STENCIL_ATTACHMENT, >- ]; >- >- let parameters = [ >- gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, >- gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, >- gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, >- gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, >- ]; >- >- for (let attachment of attachments) { >- for (let parameter of parameters) { >- let value = gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, attachment, parameter); >- assert_equals(value, null); >- assert_equals(gl.getError(), gl.INVALID_OPERATION); >+ // WebGL 2 does not throw an error and instead returns 0 when there are no >+ // attachments >+ if (gl.getParameter(gl.VERSION).includes("WebGL 1.0")) { >+ // Ensure the framebuffer attachment properties cannot be inspected. >+ let attachments = [ >+ gl.COLOR_ATTACHMENT0, >+ gl.DEPTH_ATTACHMENT, >+ gl.STENCIL_ATTACHMENT, >+ ]; >+ >+ let parameters = [ >+ gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, >+ gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, >+ gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, >+ gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, >+ ]; >+ >+ for (let attachment of attachments) { >+ for (let parameter of parameters) { >+ let value = gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, attachment, parameter); >+ assert_equals(value, null); >+ assert_equals(gl.getError(), gl.INVALID_OPERATION); >+ } > } > } > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer_stencil.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer_stencil.https.html >index 8e3e60cca058a0d8eb87f235169927309b528770..7eadd005ecf713ade2d67cb6c1308ed0493f93e0 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer_stencil.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer_stencil.https.html >@@ -3,7 +3,6 @@ > <script src="/resources/testharnessreport.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_constants.js"></script> >-<canvas /> > > <script> > let immersiveTestName = "Ensure that the framebuffer given by the WebGL layer" + >@@ -43,7 +42,7 @@ let testFunction = > const gl = sessionObjects.gl; > const webglLayer = sessionObjects.glLayer; > const xrFramebuffer = webglLayer.framebuffer; >- const webglCanvas = document.getElementsByTagName('canvas')[0]; >+ const webglCanvas = sessionObjects.gl.canvas; > > session.requestAnimationFrame((time, xrFrame) => { > t.step(() => { >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_viewports.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_viewports.https-expected.txt >index 116ebfc4da832644b0dd444119bc8884a07cdd8e..e4675d3a8b1d2be73452f770c6e33472704ac9fd 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_viewports.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_viewports.https-expected.txt >@@ -1,4 +1,6 @@ > >-PASS XRWebGLLayer reports a valid viewports for immersive sessions >-PASS XRWebGLLayer reports a valid viewports for inline sessions >+PASS XRWebGLLayer reports a valid viewports for immersive sessions - webgl >+FAIL XRWebGLLayer reports a valid viewports for immersive sessions - webgl2 assert_implements: webgl2 not supported. undefined >+PASS XRWebGLLayer reports a valid viewports for inline sessions - webgl >+FAIL XRWebGLLayer reports a valid viewports for inline sessions - webgl2 assert_implements: webgl2 not supported. undefined > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_viewports.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_viewports.https.html >index 94a23dcdb427298722a989987a02f35a8d98d055..74cc86f231b02ccc5590c7eedf9ee94974828c5d 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_viewports.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_viewports.https.html >@@ -4,7 +4,6 @@ > <script src="resources/webxr_test_constants.js"></script> > <script src="resources/webxr_util.js"></script> > <script src="resources/webxr_test_asserts.js"></script> >-<canvas></canvas> > > <script> > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webxr/xr_viewport_scale.https.html b/LayoutTests/imported/w3c/web-platform-tests/webxr/xr_viewport_scale.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..86e6f40005f43d845a547cce3404d5814f4839e8 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/webxr/xr_viewport_scale.https.html >@@ -0,0 +1,231 @@ >+<!DOCTYPE html> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="resources/webxr_test_constants.js"></script> >+<script src="resources/webxr_util.js"></script> >+<script src="resources/webxr_test_asserts.js"></script> >+ >+<script> >+ >+let fakeDeviceInitParams = TRACKED_IMMERSIVE_DEVICE; >+ >+let isValidViewport = function(viewport) { >+ // Ensure the returned object is an XRViewport object >+ assert_not_equals(viewport, null); >+ assert_true(viewport instanceof XRViewport); >+ >+ // Ensure the viewport dimensions are valid >+ assert_greater_than_equal(viewport.x, 0); >+ assert_greater_than_equal(viewport.y, 0); >+ assert_greater_than_equal(viewport.width, 1); >+ assert_greater_than_equal(viewport.height, 1); >+}; >+ >+let containsViewport = function(outer, inner) { >+ assert_greater_than_equal(inner.x, outer.x); >+ assert_greater_than_equal(inner.y, outer.y); >+ assert_less_than_equal(inner.x + inner.width, outer.x + outer.width); >+ assert_less_than_equal(inner.y + inner.height, outer.y + outer.height); >+}; >+ >+let isSameViewport = function(a, b) { >+ return a.x == b.x && a.y == b.y && a.width == b.width && a.height == b.height; >+}; >+ >+let assertSameViewport = function(a, b) { >+ assert_equals(a.x, b.x, "viewport x should match"); >+ assert_equals(a.y, b.y, "viewport y should match"); >+ assert_equals(a.width, b.width, "viewport width should match"); >+ assert_equals(a.height, b.height, "viewport height should match"); >+}; >+ >+let testFunction = function(name, firstScale, nextFrame, session, fakeDeviceController, t) { >+ return session.requestReferenceSpace('viewer') >+ .then((space) => new Promise((resolve) => { >+ function onFrame(time, xrFrame1) { >+ let debug = xr_debug.bind(this, name); >+ debug('first frame'); >+ let layer = xrFrame1.session.renderState.baseLayer; >+ >+ let fullViewports = []; >+ >+ let views1 = xrFrame1.getViewerPose(space).views; >+ >+ for (view of views1) { >+ let viewport1a = layer.getViewport(view); >+ t.step(() => isValidViewport(viewport1a)); >+ fullViewports.push(viewport1a); >+ } >+ >+ // Now request a changed viewport scale. This must not change the >+ // viewports within this frame since they were already queried. >+ // If the UA supports viewport scaling, the change applies on the >+ // next frame. If it doesn't support viewport scaling, this call >+ // has no effect. >+ for (view of views1) { >+ view.requestViewportScale(firstScale); >+ } >+ >+ t.step(() => { >+ for (let i = 0; i < views1.length; ++i) { >+ let viewport1b = layer.getViewport(views1[i]); >+ assertSameViewport(viewport1b, fullViewports[i]); >+ } >+ }); >+ >+ if (nextFrame) { >+ session.requestAnimationFrame((time, xrFrame2) => >+ nextFrame(name, t, session, space, layer, fullViewports, xrFrame2, resolve)); >+ } else { >+ // test is done >+ resolve(); >+ } >+ } >+ >+ session.requestAnimationFrame(onFrame); >+ })); >+}; >+ >+let testViewportValid = function(name, t, session, space, layer, fullViewports, xrFrame, resolve) { >+ let debug = xr_debug.bind(this, name); >+ debug('second frame'); >+ let views = xrFrame.getViewerPose(space).views; >+ for (let i = 0; i < views.length; ++i) { >+ let viewport = layer.getViewport(views[i]); >+ t.step(() => isValidViewport(viewport)); >+ t.step(() => containsViewport(fullViewports[i], viewport)); >+ } >+ resolve(); >+}; >+ >+let testScaleAppliedNextFrame = function(name, t, session, space, layer, fullViewports, xrFrame, resolve) { >+ let debug = xr_debug.bind(this, name); >+ debug('second frame'); >+ let supportsScaling = false; >+ let views = xrFrame.getViewerPose(space).views; >+ for (let i = 0; i < views.length; ++i) { >+ let viewport = layer.getViewport(views[i]); >+ t.step(() => isValidViewport(viewport)); >+ t.step(() => containsViewport(fullViewports[i], viewport)); >+ if (!isSameViewport(fullViewports[i], viewport)) { >+ supportsScaling = true; >+ } >+ } >+ debug("supportsScaling=" + supportsScaling); >+ t.step(() => { >+ assert_implements_optional(supportsScaling, "requestViewportScale has no effect"); >+ }); >+ resolve(); >+}; >+ >+let testScaleSameFrame = function(name, t, session, space, layer, fullViewports, xrFrame, resolve) { >+ let debug = xr_debug.bind(this, name); >+ debug('second frame'); >+ let supportsScaling = false; >+ let views = xrFrame.getViewerPose(space).views; >+ let viewports2 = []; >+ for (let i = 0; i < views.length; ++i) { >+ let viewport2 = layer.getViewport(views[i]); >+ viewports2.push(viewport2); >+ if (!isSameViewport(fullViewports[i], viewport2)) { >+ supportsScaling = true; >+ } >+ } >+ debug("supportsScaling=" + supportsScaling); >+ if (!supportsScaling) { >+ // End the test early. >+ t.step(() => { >+ assert_implements_optional(false, "requestViewportScale has no effect"); >+ resolve(); >+ }); >+ } >+ >+ session.requestAnimationFrame((time, xrFrame3) => { >+ let views3 = xrFrame3.getViewerPose(space).views; >+ // Apply a new viewport scale before requesting viewports, >+ // this should take effect on the same frame. >+ for (view of views3) { >+ view.requestViewportScale(0.75); >+ } >+ for (let i = 0; i < views3.length; ++i) { >+ let viewport3 = layer.getViewport(views3[i]); >+ t.step(() => isValidViewport(viewport3)); >+ t.step(() => containsViewport(fullViewports[i], viewport3)); >+ t.step(() => containsViewport(viewport3, viewports2[i])); >+ t.step(() => { >+ // We don't know the exact expected size, but it should be in >+ // between the half-size and full-size viewports. >+ assert_false(isSameViewport(viewports2[i], viewport3)); >+ assert_false(isSameViewport(fullViewports[i], viewport3)); >+ }); >+ } >+ resolve(); >+ }); >+}; >+ >+let testRecommendedScale = function(name, t, session, space, layer, fullViewports, xrFrame, resolve) { >+ let debug = xr_debug.bind(this, name); >+ debug('second frame'); >+ let views = xrFrame.getViewerPose(space).views; >+ let haveRecommendedScale = false; >+ for (view of views) { >+ let recommended = view.recommendedViewportScale; >+ view.requestViewportScale(recommended); >+ if (recommended !== null && recommended !== undefined) { >+ haveRecommendedScale = true; >+ t.step(() => { >+ assert_greater_than(recommended, 0.0, "recommended scale invalid"); >+ assert_less_than_equal(recommended, 1.0, "recommended scale invalid"); >+ }); >+ } >+ } >+ t.step(() => { >+ assert_implements_optional(haveRecommendedScale, "recommendedViewportScale not provided"); >+ }); >+ for (let i = 0; i < views.length; ++i) { >+ let viewport = layer.getViewport(views[i]); >+ t.step(() => isValidViewport(viewport)); >+ t.step(() => containsViewport(fullViewports[i], viewport)); >+ } >+ resolve(); >+}; >+ >+for (let mode of ['inline', 'immersive-vr']) { >+ xr_session_promise_test( >+ "requestViewportScale valid viewport for " + mode + " session", >+ testFunction.bind(this, "valid viewport (0.5) " + mode, 0.5, testViewportValid), >+ fakeDeviceInitParams, >+ mode); >+ xr_session_promise_test( >+ "requestViewportScale valid viewport w/ null scale for " + mode + " session", >+ testFunction.bind(this, "valid viewport (null) " + mode, null, testViewportValid), >+ fakeDeviceInitParams, >+ mode); >+ xr_session_promise_test( >+ "requestViewportScale valid viewport w/ undefined scale for " + mode + " session", >+ testFunction.bind(this, "valid viewport (undefined) " + mode, null, testViewportValid), >+ fakeDeviceInitParams, >+ mode); >+ xr_session_promise_test( >+ "requestViewportScale valid viewport w/ very small scale for " + mode + " session", >+ testFunction.bind(this, "valid viewport (tiny) " + mode, 1e-6, testViewportValid), >+ fakeDeviceInitParams, >+ mode); >+ xr_session_promise_test( >+ "requestViewportScale applied next frame for " + mode + " session", >+ testFunction.bind(this, "scale applied next frame " + mode, 0.5, testScaleAppliedNextFrame), >+ fakeDeviceInitParams, >+ mode); >+ xr_session_promise_test( >+ "requestViewportScale same frame for " + mode + " session", >+ testFunction.bind(this, "same frame " + mode, 0.5, testScaleSameFrame), >+ fakeDeviceInitParams, >+ mode); >+ xr_session_promise_test( >+ "recommendedViewportScale for " + mode + " session", >+ testFunction.bind(this, "recommendedViewportScale " + mode, 0.5, testRecommendedScale), >+ fakeDeviceInitParams, >+ mode); >+} >+ >+</script>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 224935
:
429524
|
429525