diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2020-02-15 07:59:39 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-15 07:59:39 -0500 |
commit | 3475790fc23f939560f546901bf3082ebf20508a (patch) | |
tree | 3ee9b720faf6bfc2dddf8771e2ea40200c47c483 | |
parent | 795dab71fffe98434308732e4cb8ee682f28e465 (diff) | |
parent | 54c8cac1cd4bec197b42b3a15304fac81d0e2c30 (diff) | |
download | servo-3475790fc23f939560f546901bf3082ebf20508a.tar.gz servo-3475790fc23f939560f546901bf3082ebf20508a.zip |
Auto merge of #25770 - Manishearth:sessionsupport, r=jdm
supportsSession() -> isSessionSupported()
r? @jdm
fixes https://github.com/servo/servo/issues/25596
7 files changed, 10 insertions, 27 deletions
diff --git a/components/script/dom/webidls/XR.webidl b/components/script/dom/webidls/XR.webidl index 8b0311f0c3f..1c1e880eab2 100644 --- a/components/script/dom/webidls/XR.webidl +++ b/components/script/dom/webidls/XR.webidl @@ -6,7 +6,7 @@ [SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] interface XR: EventTarget { // Methods - Promise<void> supportsSession(XRSessionMode mode); + Promise<boolean> isSessionSupported(XRSessionMode mode); Promise<XRSession> requestSession(XRSessionMode mode, optional XRSessionInit parameters = {}); // Events diff --git a/components/script/dom/xr.rs b/components/script/dom/xr.rs index 00f86203b26..2356083687f 100644 --- a/components/script/dom/xr.rs +++ b/components/script/dom/xr.rs @@ -113,8 +113,8 @@ impl Into<SessionMode> for XRSessionMode { } impl XRMethods for XR { - /// https://immersive-web.github.io/webxr/#dom-xr-supportssessionmode - fn SupportsSession(&self, mode: XRSessionMode) -> Rc<Promise> { + /// https://immersive-web.github.io/webxr/#dom-xr-issessionsupported + fn IsSessionSupported(&self, mode: XRSessionMode) -> Rc<Promise> { // XXXManishearth this should select an XR device first let promise = Promise::new(&self.global()); let mut trusted = Some(TrustedPromise::new(promise.clone())); @@ -141,10 +141,11 @@ impl XRMethods for XR { return; }; if let Ok(()) = message { - let _ = task_source.queue_with_canceller(trusted.resolve_task(()), &canceller); + let _ = + task_source.queue_with_canceller(trusted.resolve_task(true), &canceller); } else { - let _ = task_source - .queue_with_canceller(trusted.reject_task(Error::NotSupported), &canceller); + let _ = + task_source.queue_with_canceller(trusted.resolve_task(false), &canceller); }; }), ); diff --git a/tests/wpt/metadata/webxr/ar-module/xrDevice_isSessionSupported_immersive-ar.https.html.ini b/tests/wpt/metadata/webxr/ar-module/xrDevice_isSessionSupported_immersive-ar.https.html.ini index b4c7bff7568..178edb6ed13 100644 --- a/tests/wpt/metadata/webxr/ar-module/xrDevice_isSessionSupported_immersive-ar.https.html.ini +++ b/tests/wpt/metadata/webxr/ar-module/xrDevice_isSessionSupported_immersive-ar.https.html.ini @@ -1,7 +1,4 @@ [xrDevice_isSessionSupported_immersive-ar.https.html] - [isSessionSupported resolves to true for immersive-ar on a supported device] - expected: FAIL - [isSessionSupported resolves to false for immersive-ar on an unsupported device] expected: FAIL diff --git a/tests/wpt/metadata/webxr/idlharness.https.window.js.ini b/tests/wpt/metadata/webxr/idlharness.https.window.js.ini index df4d0eabbcd..35d48de8e43 100644 --- a/tests/wpt/metadata/webxr/idlharness.https.window.js.ini +++ b/tests/wpt/metadata/webxr/idlharness.https.window.js.ini @@ -116,18 +116,15 @@ [XRSession interface: operation end()] expected: FAIL - [XR interface: operation isSessionSupported(XRSessionMode)] - expected: FAIL - [XR interface: calling isSessionSupported(XRSessionMode) on navigator.xr with too few arguments must throw TypeError] expected: FAIL - [XR interface: navigator.xr must inherit property "isSessionSupported(XRSessionMode)" with the proper type] - expected: FAIL - [WebGLRenderingContext includes WebGLRenderingContextOverloads: member names are unique] expected: FAIL [WebGLRenderingContext includes WebGLRenderingContextBase: member names are unique] expected: FAIL + [XR interface: operation isSessionSupported(XRSessionMode)] + expected: FAIL + diff --git a/tests/wpt/metadata/webxr/xrDevice_isSessionSupported_immersive.https.html.ini b/tests/wpt/metadata/webxr/xrDevice_isSessionSupported_immersive.https.html.ini deleted file mode 100644 index 638ff2a383c..00000000000 --- a/tests/wpt/metadata/webxr/xrDevice_isSessionSupported_immersive.https.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[xrDevice_isSessionSupported_immersive.https.html] - [isSessionSupported resolves to true when immersive options supported] - expected: FAIL - diff --git a/tests/wpt/metadata/webxr/xrDevice_isSessionSupported_immersive_unsupported.https.html.ini b/tests/wpt/metadata/webxr/xrDevice_isSessionSupported_immersive_unsupported.https.html.ini deleted file mode 100644 index 11747c997a7..00000000000 --- a/tests/wpt/metadata/webxr/xrDevice_isSessionSupported_immersive_unsupported.https.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[xrDevice_isSessionSupported_immersive_unsupported.https.html] - [isSessionSupported resolves to false when options not supported] - expected: FAIL - diff --git a/tests/wpt/metadata/webxr/xrDevice_isSessionSupported_inline.https.html.ini b/tests/wpt/metadata/webxr/xrDevice_isSessionSupported_inline.https.html.ini deleted file mode 100644 index 7b958e3bdca..00000000000 --- a/tests/wpt/metadata/webxr/xrDevice_isSessionSupported_inline.https.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[xrDevice_isSessionSupported_inline.https.html] - [isSessionSupported resolves to true when inline options supported] - expected: FAIL - |