Skip to content

Commit 847da81

Browse files
committed
Bug 1629229 [wpt PR 22868] - Implement hit testing API, a=testonly
Automatic update from web-platform-tests Update xrRay_constructor test to not throw See immersive-web/hit-test#83, this test is currently impossible to pass for a browser implementing the current WebIDL specification. -- Update XRRay semantics Implements changes from immersive-web/hit-test#85 -- Fix world generation to have vertices member -- wpt-commits: 7513c92e130e043def925bda97e9fb9d8fd0b48f, 0fce2e94f0feb04966868a0b5795d76ea1db3906, 08c95d8ca3466c37df307cb775502a916e22b814 wpt-pr: 22868 UltraBlame original commit: 309322031e57b9f606c20274ad42711703753086
1 parent d47b8b5 commit 847da81

File tree

2 files changed

+170
-65
lines changed

2 files changed

+170
-65
lines changed

testing/web-platform/tests/webxr/hit-test/xrRay_constructor.https.html

Lines changed: 130 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@
734734
{
735735
x
736736
:
737-
0
737+
1
738738
.
739739
0
740740
y
@@ -754,11 +754,13 @@
754754
0
755755
}
756756
;
757-
try
758-
{
759-
let
760-
xrRay
757+
assert_throws_js
758+
(
759+
TypeError
760+
(
761+
)
761762
=
763+
>
762764
new
763765
XRRay
764766
(
@@ -772,92 +774,155 @@
772774
.
773775
fromPoint
774776
(
775-
directionDict
777+
{
778+
x
779+
:
780+
0
781+
.
782+
0
783+
y
784+
:
785+
0
786+
.
787+
0
788+
z
789+
:
790+
0
791+
.
792+
0
793+
w
794+
:
795+
0
796+
.
797+
0
798+
}
776799
)
777800
)
778-
;
779-
assert
780-
(
781-
false
782801
"
783-
origin
784-
-
785-
custom
786-
-
787-
direction
788-
-
802+
Constructor
803+
should
804+
throw
805+
for
789806
zero
790-
:
791-
exception
792-
not
793-
thrown
807+
direction
794808
"
795809
)
796810
;
797-
}
798-
catch
811+
assert_throws_js
812+
(
813+
TypeError
799814
(
800-
e
801815
)
802-
{
803-
if
816+
=
817+
>
818+
new
819+
XRRay
804820
(
805-
e
806-
instanceof
807-
DOMException
821+
DOMPoint
822+
.
823+
fromPoint
824+
(
825+
originDict
808826
)
809-
{
810-
assert_equals
827+
DOMPoint
828+
.
829+
fromPoint
811830
(
812-
e
831+
{
832+
x
833+
:
834+
1
813835
.
814-
name
815-
"
816-
InvalidStateError
817-
"
836+
0
837+
y
838+
:
839+
0
840+
.
841+
0
842+
z
843+
:
844+
0
845+
.
846+
0
847+
w
848+
:
849+
0
850+
.
851+
5
852+
}
853+
)
854+
)
818855
"
819-
origin
820-
-
821-
custom
822-
-
856+
Constructor
857+
should
858+
throw
859+
for
860+
nonzero
823861
direction
824-
-
825-
zero
826-
:
827-
incorrect
828-
DOM
829-
exception
830-
thrown
862+
w
863+
coordinate
831864
"
832865
)
833866
;
834-
}
835-
else
867+
assert_throws_js
868+
(
869+
TypeError
870+
(
871+
)
872+
=
873+
>
874+
new
875+
XRRay
876+
(
877+
DOMPoint
878+
.
879+
fromPoint
880+
(
836881
{
837-
assert
882+
x
883+
:
884+
10
885+
.
886+
0
887+
y
888+
:
889+
10
890+
.
891+
0
892+
z
893+
:
894+
10
895+
.
896+
0
897+
w
898+
:
899+
0
900+
.
901+
5
902+
}
903+
)
904+
DOMPoint
905+
.
906+
fromPoint
838907
(
839-
false
908+
directionDict
909+
)
910+
)
840911
"
841-
origin
842-
-
843-
custom
844-
-
845-
direction
912+
Constructor
913+
should
914+
throw
915+
for
916+
non
846917
-
847-
zero
848-
:
849-
other
850-
exception
851-
thrown
852-
:
918+
1
919+
origin
920+
w
921+
coordinate
853922
"
854-
+
855-
e
856923
)
857924
;
858925
}
859-
}
860-
}
861926
/
862927
/
863928
/

testing/web-platform/tests/webxr/resources/webxr_test_constants_fake_world.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,68 +214,108 @@ const
214214
FRONT_WALL_AND_FLOOR_FACES
215215
=
216216
[
217+
{
218+
vertices
219+
:
217220
[
218221
BOTTOM_LEFT_FRONT
219222
BOTTOM_RIGHT_FRONT
220223
TOP_RIGHT_FRONT
221224
]
225+
}
226+
{
227+
vertices
228+
:
222229
[
223230
BOTTOM_LEFT_FRONT
224231
TOP_RIGHT_FRONT
225232
TOP_LEFT_FRONT
226233
]
234+
}
235+
{
236+
vertices
237+
:
227238
[
228239
BOTTOM_LEFT_FRONT
229240
BOTTOM_RIGHT_FRONT
230241
BOTTOM_RIGHT_BACK
231242
]
243+
}
244+
{
245+
vertices
246+
:
232247
[
233248
BOTTOM_LEFT_FRONT
234249
BOTTOM_LEFT_BACK
235250
BOTTOM_RIGHT_BACK
236251
]
252+
}
237253
]
238254
;
239255
const
240256
CEILING_FACES
241257
=
242258
[
259+
{
260+
vertices
261+
:
243262
[
244263
TOP_LEFT_FRONT
245264
TOP_RIGHT_FRONT
246265
TOP_RIGHT_BACK
247266
]
267+
}
268+
{
269+
vertices
270+
:
248271
[
249272
TOP_LEFT_FRONT
250273
TOP_LEFT_BACK
251274
TOP_RIGHT_BACK
252275
]
276+
}
253277
]
254278
;
255279
const
256280
SIDE_WALLS_FACES
257281
=
258282
[
283+
{
284+
vertices
285+
:
259286
[
260287
BOTTOM_LEFT_FRONT
261288
TOP_LEFT_FRONT
262289
TOP_LEFT_BACK
263290
]
291+
}
292+
{
293+
vertices
294+
:
264295
[
265296
BOTTOM_LEFT_FRONT
266297
BOTTOM_LEFT_BACK
267298
TOP_LEFT_BACK
268299
]
300+
}
301+
{
302+
vertices
303+
:
269304
[
270305
BOTTOM_RIGHT_FRONT
271306
TOP_RIGHT_FRONT
272307
TOP_RIGHT_BACK
273308
]
309+
}
310+
{
311+
vertices
312+
:
274313
[
275314
BOTTOM_RIGHT_FRONT
276315
BOTTOM_RIGHT_BACK
277316
TOP_RIGHT_BACK
278317
]
318+
}
279319
]
280320
;
281321
const

0 commit comments

Comments
 (0)