summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webxr/ar-module
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/ar-module
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/ar-module')
-rw-r--r--testing/web-platform/tests/webxr/ar-module/META.yml1
-rw-r--r--testing/web-platform/tests/webxr/ar-module/idlharness.https.window.js17
-rw-r--r--testing/web-platform/tests/webxr/ar-module/xrDevice_isSessionSupported_immersive-ar.https.html34
-rw-r--r--testing/web-platform/tests/webxr/ar-module/xrDevice_requestSession_immersive-ar.https.html27
-rw-r--r--testing/web-platform/tests/webxr/ar-module/xrSession_environmentBlendMode.https.html23
-rw-r--r--testing/web-platform/tests/webxr/ar-module/xrSession_interactionMode.https.html84
6 files changed, 186 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webxr/ar-module/META.yml b/testing/web-platform/tests/webxr/ar-module/META.yml
new file mode 100644
index 0000000000..47e5ea9cd4
--- /dev/null
+++ b/testing/web-platform/tests/webxr/ar-module/META.yml
@@ -0,0 +1 @@
+spec: https://immersive-web.github.io/webxr-ar-module/
diff --git a/testing/web-platform/tests/webxr/ar-module/idlharness.https.window.js b/testing/web-platform/tests/webxr/ar-module/idlharness.https.window.js
new file mode 100644
index 0000000000..51cc3c4280
--- /dev/null
+++ b/testing/web-platform/tests/webxr/ar-module/idlharness.https.window.js
@@ -0,0 +1,17 @@
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+
+'use strict';
+
+// https://immersive-web.github.io/webxr-ar-module/
+
+idl_test(
+ ['webxr-ar-module'],
+ ['webxr', 'dom'],
+ async idl_array => {
+ idl_array.add_objects({
+ XRSession: ['xrSession'],
+ });
+ self.xrSession = await navigator.xr.requestSession('inline');
+ }
+);
diff --git a/testing/web-platform/tests/webxr/ar-module/xrDevice_isSessionSupported_immersive-ar.https.html b/testing/web-platform/tests/webxr/ar-module/xrDevice_isSessionSupported_immersive-ar.https.html
new file mode 100644
index 0000000000..2cd36a17f6
--- /dev/null
+++ b/testing/web-platform/tests/webxr/ar-module/xrDevice_isSessionSupported_immersive-ar.https.html
@@ -0,0 +1,34 @@
+<!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_promise_test(
+ "isSessionSupported resolves to true for immersive-ar on a supported device",
+ (t) => {
+ return navigator.xr.test.simulateDeviceConnection(IMMERSIVE_AR_DEVICE)
+ .then( (controller) => {
+ return navigator.xr.isSessionSupported('immersive-ar').then((supported) => {
+ t.step(() => {
+ assert_true(supported);
+ });
+ });
+ });
+ });
+
+ xr_promise_test(
+ "isSessionSupported resolves to false for immersive-ar on an unsupported device",
+ (t) => {
+ return navigator.xr.test.simulateDeviceConnection(TRACKED_IMMERSIVE_DEVICE)
+ .then( (controller) => {
+ return navigator.xr.isSessionSupported('immersive-ar').then((supported) => {
+ t.step(() => {
+ assert_false(supported);
+ });
+ });
+ });
+ });
+</script>
+</body>
diff --git a/testing/web-platform/tests/webxr/ar-module/xrDevice_requestSession_immersive-ar.https.html b/testing/web-platform/tests/webxr/ar-module/xrDevice_requestSession_immersive-ar.https.html
new file mode 100644
index 0000000000..9984ee589d
--- /dev/null
+++ b/testing/web-platform/tests/webxr/ar-module/xrDevice_requestSession_immersive-ar.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>
+ xr_session_promise_test(
+ "Tests requestSession accepts immersive-ar mode",
+ (session) => {
+ assert_not_equals(session, null);
+ }, IMMERSIVE_AR_DEVICE, 'immersive-ar', {});
+
+ xr_promise_test(
+ "Tests requestSession rejects immersive-ar mode when unsupported",
+ (t) => {
+ return navigator.xr.test.simulateDeviceConnection(TRACKED_IMMERSIVE_DEVICE)
+ .then((controller) => new Promise((resolve) => {
+ navigator.xr.test.simulateUserActivation(() => {
+ resolve(promise_rejects_dom(
+ t, "NotSupportedError",
+ navigator.xr.requestSession('immersive-ar', {})));
+ });
+ }));
+ });
+</script>
+</body>
diff --git a/testing/web-platform/tests/webxr/ar-module/xrSession_environmentBlendMode.https.html b/testing/web-platform/tests/webxr/ar-module/xrSession_environmentBlendMode.https.html
new file mode 100644
index 0000000000..beff66586c
--- /dev/null
+++ b/testing/web-platform/tests/webxr/ar-module/xrSession_environmentBlendMode.https.html
@@ -0,0 +1,23 @@
+<!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(
+ "Tests environmentBlendMode for an AR device",
+ (session) => {
+ assert_not_equals(session.environmentBlendMode, "opaque");
+ assert_in_array(session.environmentBlendMode, ["alpha-blend", "additive"]);
+ }, IMMERSIVE_AR_DEVICE, 'immersive-ar', {});
+
+
+ xr_session_promise_test(
+ "Tests environmentBlendMode for a VR device",
+ (session) => {
+ assert_not_equals(session.environmentBlendMode, "alpha-blend");
+ assert_in_array(session.environmentBlendMode, ["opaque", "additive"]);
+ }, TRACKED_IMMERSIVE_DEVICE, 'immersive-vr', {});
+</script>
+</body> \ No newline at end of file
diff --git a/testing/web-platform/tests/webxr/ar-module/xrSession_interactionMode.https.html b/testing/web-platform/tests/webxr/ar-module/xrSession_interactionMode.https.html
new file mode 100644
index 0000000000..89cdc80132
--- /dev/null
+++ b/testing/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>