summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webxr/anchors/ar_anchor_getAnchors.https.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /testing/web-platform/tests/webxr/anchors/ar_anchor_getAnchors.https.html
parentInitial commit. (diff)
downloadthunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz
thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/webxr/anchors/ar_anchor_getAnchors.https.html')
-rw-r--r--testing/web-platform/tests/webxr/anchors/ar_anchor_getAnchors.https.html58
1 files changed, 58 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webxr/anchors/ar_anchor_getAnchors.https.html b/testing/web-platform/tests/webxr/anchors/ar_anchor_getAnchors.https.html
new file mode 100644
index 0000000000..50664b0a4b
--- /dev/null
+++ b/testing/web-platform/tests/webxr/anchors/ar_anchor_getAnchors.https.html
@@ -0,0 +1,58 @@
+<!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>
+
+// 1m above world origin.
+const VIEWER_ORIGIN_TRANSFORM = {
+ position: [0, 1, 0],
+ orientation: [0, 0, 0, 1],
+};
+
+const fakeDeviceInitParams = {
+ supportedModes: ["immersive-ar"],
+ views: VALID_VIEWS,
+ supportedFeatures: ALL_FEATURES,
+ viewerOrigin: VIEWER_ORIGIN_TRANSFORM,
+};
+
+// Attempts to access XRFrame.trackedAnchors and expects to get empty set
+// since no anchors are being created.
+const testFunction = function(session, fakeDeviceController, t) {
+ const debug = xr_debug.bind(this, 'testGetAnchors');
+
+ let done = false;
+
+ session.requestReferenceSpace('local').then((localRefSpace) => {
+ const onFrame = function(time, frame) {
+ const trackedAnchors = frame.trackedAnchors;
+ t.step(() => {
+ assert_equals(trackedAnchors.size, 0);
+ });
+
+ done = true;
+ };
+
+ session.requestAnimationFrame(onFrame);
+ }); // session.requestReferenceSpace(...)
+
+ return t.step_wait(() => done);
+}; // testFunction
+
+
+xr_session_promise_test("XRFrame's trackedAnchors is empty when the feature was not requested",
+ testFunction,
+ fakeDeviceInitParams,
+ 'immersive-ar', { });
+
+xr_session_promise_test("XRFrame's trackedAnchors is empty when the feature was requested",
+ testFunction,
+ fakeDeviceInitParams,
+ 'immersive-ar', { 'requiredFeatures': ['anchors'] });
+
+</script>