diff --git a/components/script/dom/xr.rs b/components/script/dom/xr.rs index 4f5a90e89c4..72cc573d645 100644 --- a/components/script/dom/xr.rs +++ b/components/script/dom/xr.rs @@ -162,12 +162,12 @@ impl XRMethods for XR { ) -> Rc { let promise = Promise::new_in_current_compartment(&self.global(), comp); - if !ScriptThread::is_user_interacting() { - promise.reject_error(Error::Security); - return promise; - } - if mode != XRSessionMode::Inline { + if !ScriptThread::is_user_interacting() { + promise.reject_error(Error::Security); + return promise; + } + if self.pending_or_active_session() { promise.reject_error(Error::InvalidState); return promise; diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index ffb4acddd68..368f6db126b 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -727683,7 +727683,7 @@ "testharness" ], "webxr/xrWebGLLayer_constructor.https.html": [ - "0584da79c12def757f951ec53c4c048f18c39b8c", + "dda7ec80310f7ff8aac582a98410886ab4d1b81d", "testharness" ], "webxr/xrWebGLLayer_framebuffer_draw.https.html": [ diff --git a/tests/wpt/metadata/webxr/xrDevice_requestSession_non_immersive_no_gesture.https.html.ini b/tests/wpt/metadata/webxr/xrDevice_requestSession_non_immersive_no_gesture.https.html.ini deleted file mode 100644 index b6ba334933d..00000000000 --- a/tests/wpt/metadata/webxr/xrDevice_requestSession_non_immersive_no_gesture.https.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[xrDevice_requestSession_non_immersive_no_gesture.https.html] - [Requesting non-immersive session outside of a user gesture succeeds] - expected: FAIL - diff --git a/tests/wpt/metadata/webxr/xrWebGLLayer_constructor.https.html.ini b/tests/wpt/metadata/webxr/xrWebGLLayer_constructor.https.html.ini index f9f55152f51..08a51f5b1bc 100644 --- a/tests/wpt/metadata/webxr/xrWebGLLayer_constructor.https.html.ini +++ b/tests/wpt/metadata/webxr/xrWebGLLayer_constructor.https.html.ini @@ -1,4 +1,5 @@ [xrWebGLLayer_constructor.https.html] + expected: ERROR [Ensure that XRWebGLLayer's constructor throws appropriate errors] - expected: FAIL + expected: TIMEOUT diff --git a/tests/wpt/web-platform-tests/webxr/xrWebGLLayer_constructor.https.html b/tests/wpt/web-platform-tests/webxr/xrWebGLLayer_constructor.https.html index 0584da79c12..dda7ec80310 100644 --- a/tests/wpt/web-platform-tests/webxr/xrWebGLLayer_constructor.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrWebGLLayer_constructor.https.html @@ -31,12 +31,14 @@ xr_promise_test("Ensure that XRWebGLLayer's constructor throws appropriate error navigator.xr.test.simulateUserActivation(() => { navigator.xr.requestSession('immersive-vr') .then((session) => { - try { - let webglLayerIncompatible = new XRWebGLLayer(session, gl); - assert_unreached("XRWebGLLayer should fail when created with a context that is not XRCompatible") - } catch (err) { - assert_equals(err.name, "InvalidStateError"); - } + t.step_func(() => { + try { + let webglLayerIncompatible = new XRWebGLLayer(session, gl); + assert_unreached("XRWebGLLayer should fail when created with a context that is not XRCompatible") + } catch (err) { + assert_equals(err.name, "InvalidStateError"); + } + }) gl.makeXRCompatible();