aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wpt/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html')
-rw-r--r--tests/wpt/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html b/tests/wpt/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html
new file mode 100644
index 00000000000..f412c6fb2e0
--- /dev/null
+++ b/tests/wpt/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html
@@ -0,0 +1,40 @@
+<!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>
+
+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)
+ .then((controller) => {
+ assert_false(gl.getContextAttributes().xrCompatible);
+ return gl.makeXRCompatible();
+ }).then(() => {
+ assert_true(gl.getContextAttributes().xrCompatible);
+ return gl.makeXRCompatible();
+ }).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)
+ .then((controller) => {
+ assert_false(gl.getContextAttributes().xrCompatible);
+
+ return Promise.all([gl.makeXRCompatible(),
+ gl.makeXRCompatible(),
+ gl.makeXRCompatible()]);
+ }).then(() => {
+ assert_true(gl.getContextAttributes().xrCompatible);
+ });
+ });
+
+</script>