From 2b082695c3248193f2ddcd19f95448c89cbe6966 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Sun, 3 May 2020 16:14:52 +0000 Subject: [PATCH] Bug 1628931 [wpt PR 22836] - Add interfaces/hit-test.idl and test, a=testonly Automatic update from web-platform-tests Add interfaces/hit-test.idl and test (#22836) Due to the difficulty in testing webxr until test-only APIs are supported in WPT (see https://github.com/web-platform-tests/wpt/issues/16455#issuecomment-532040838), the added test only tests the XRSession interface additions for now. Closes https://github.com/web-platform-tests/wpt/pull/22155 -- wpt-commits: 8a9e492c5bbfafeeb074902ab39910348a20776a wpt-pr: 22836 UltraBlame original commit: 98cd0a5fb4a5952175d709aee6a2593c33f35ab9 --- .../tests/hit-test/idlharness.https.html | 220 +++++++++++++ .../tests/interfaces/hit-test.idl | 292 ++++++++++++++++++ 2 files changed, 512 insertions(+) create mode 100644 testing/web-platform/tests/hit-test/idlharness.https.html create mode 100644 testing/web-platform/tests/interfaces/hit-test.idl diff --git a/testing/web-platform/tests/hit-test/idlharness.https.html b/testing/web-platform/tests/hit-test/idlharness.https.html new file mode 100644 index 0000000000000..34e21bfe86a47 --- /dev/null +++ b/testing/web-platform/tests/hit-test/idlharness.https.html @@ -0,0 +1,220 @@ +< +! +doctype +html +> +< +title +> +WebXR +hit +- +test +IDL +tests +< +/ +title +> +< +link +rel += +" +help +" +href += +" +https +: +/ +/ +immersive +- +web +. +github +. +io +/ +hit +- +test +/ +" +> +< +script +src += +" +/ +resources +/ +testharness +. +js +" +> +< +/ +script +> +< +script +src += +" +/ +resources +/ +testharnessreport +. +js +" +> +< +/ +script +> +< +script +src += +" +/ +resources +/ +WebIDLParser +. +js +" +> +< +/ +script +> +< +script +src += +" +/ +resources +/ +idlharness +. +js +" +> +< +/ +script +> +< +script +> +' +use +strict +' +; +idl_test +( +[ +' +hit +- +test +' +] +[ +' +webxr +' +' +geometry +' +' +dom +' +] +async +idl_array += +> +{ +idl_array +. +add_objects +( +{ +/ +/ +TODO +: +XRHitTestSource +/ +/ +TODO +: +XRTransientInputHitTestSource +/ +/ +TODO +: +XRHitTestResult +/ +/ +TODO +: +XRTransientInputHitTestResult +XRSession +: +[ +' +xrSession +' +] +/ +/ +TODO +: +XRFrame +XRRay +: +[ +' +new +XRRay +( +) +' +] +} +) +; +self +. +xrSession += +await +navigator +. +xr +. +requestSession +( +" +inline +" +) +; +} +) +; +< +/ +script +> diff --git a/testing/web-platform/tests/interfaces/hit-test.idl b/testing/web-platform/tests/interfaces/hit-test.idl new file mode 100644 index 0000000000000..53476e926e0a1 --- /dev/null +++ b/testing/web-platform/tests/interfaces/hit-test.idl @@ -0,0 +1,292 @@ +/ +/ +GENERATED +CONTENT +- +DO +NOT +EDIT +/ +/ +Content +was +automatically +extracted +by +Reffy +into +reffy +- +reports +/ +/ +( +https +: +/ +/ +github +. +com +/ +tidoust +/ +reffy +- +reports +) +/ +/ +Source +: +WebXR +Hit +Test +Module +( +https +: +/ +/ +immersive +- +web +. +github +. +io +/ +hit +- +test +/ +) +enum +XRHitTestTrackableType +{ +" +point +" +" +plane +" +" +mesh +" +} +; +dictionary +XRHitTestOptionsInit +{ +required +XRSpace +space +; +FrozenArray +< +XRHitTestTrackableType +> +entityTypes +; +XRRay +offsetRay +; +} +; +dictionary +XRTransientInputHitTestOptionsInit +{ +required +DOMString +profile +; +FrozenArray +< +XRHitTestTrackableType +> +entityTypes +; +XRRay +offsetRay +; +} +; +[ +SecureContext +Exposed += +Window +] +interface +XRHitTestSource +{ +void +cancel +( +) +; +} +; +[ +SecureContext +Exposed += +Window +] +interface +XRTransientInputHitTestSource +{ +void +cancel +( +) +; +} +; +[ +SecureContext +Exposed += +Window +] +interface +XRHitTestResult +{ +XRPose +? +getPose +( +XRSpace +baseSpace +) +; +} +; +[ +SecureContext +Exposed += +Window +] +interface +XRTransientInputHitTestResult +{ +[ +SameObject +] +readonly +attribute +XRInputSource +inputSource +; +readonly +attribute +FrozenArray +< +XRHitTestResult +> +results +; +} +; +partial +interface +XRSession +{ +Promise +< +XRHitTestSource +> +requestHitTestSource +( +XRHitTestOptionsInit +options +) +; +Promise +< +XRTransientInputHitTestSource +> +requestHitTestSourceForTransientInput +( +XRTransientInputHitTestOptionsInit +options +) +; +} +; +partial +interface +XRFrame +{ +FrozenArray +< +XRHitTestResult +> +getHitTestResults +( +XRHitTestSource +hitTestSource +) +; +FrozenArray +< +XRTransientInputHitTestResult +> +getHitTestResultsForTransientInput +( +XRTransientInputHitTestSource +hitTestSource +) +; +} +; +[ +SecureContext +Exposed += +Window +Constructor +( +optional +DOMPointInit +origin +optional +DOMPointInit +direction +) +Constructor +( +XRRigidTransform +transform +) +] +interface +XRRay +{ +[ +SameObject +] +readonly +attribute +DOMPointReadOnly +origin +; +[ +SameObject +] +readonly +attribute +DOMPointReadOnly +direction +; +[ +SameObject +] +readonly +attribute +Float32Array +matrix +; +} +;