aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2019-07-16 16:14:26 -0700
committerManish Goregaokar <manishsmail@gmail.com>2019-07-16 22:17:22 -0700
commitffc943fec7cda035d4dacdec044409686e90bb86 (patch)
tree2c79c8c4687ce7d4a6871aa53697a970ac76a640
parentdf1f865cb2f1baaf398641a92542f5b015a3304e (diff)
downloadservo-ffc943fec7cda035d4dacdec044409686e90bb86.tar.gz
servo-ffc943fec7cda035d4dacdec044409686e90bb86.zip
Add stubs for session start/end
-rw-r--r--components/script/dom/webidls/XRSession.webidl2
-rw-r--r--components/script/dom/webidls/XRTest.webidl2
-rw-r--r--components/script/dom/xrsession.rs8
-rw-r--r--components/script/dom/xrtest.rs8
4 files changed, 18 insertions, 2 deletions
diff --git a/components/script/dom/webidls/XRSession.webidl b/components/script/dom/webidls/XRSession.webidl
index d35f724f87e..1429579353b 100644
--- a/components/script/dom/webidls/XRSession.webidl
+++ b/components/script/dom/webidls/XRSession.webidl
@@ -33,7 +33,7 @@ interface XRSession : EventTarget {
long requestAnimationFrame(XRFrameRequestCallback callback);
void cancelAnimationFrame(long handle);
- // Promise<void> end();
+ Promise<void> end();
// // Events
// attribute EventHandler onblur;
diff --git a/components/script/dom/webidls/XRTest.webidl b/components/script/dom/webidls/XRTest.webidl
index 89af1da991e..a190fd75472 100644
--- a/components/script/dom/webidls/XRTest.webidl
+++ b/components/script/dom/webidls/XRTest.webidl
@@ -16,7 +16,7 @@ interface XRTest {
void simulateUserActivation(Function f);
// // Disconnect all fake devices
- // Promise<void> disconnectAllDevices();
+ Promise<void> disconnectAllDevices();
};
dictionary FakeXRDeviceInit {
diff --git a/components/script/dom/xrsession.rs b/components/script/dom/xrsession.rs
index 77f4b4cafb4..f87108e7f47 100644
--- a/components/script/dom/xrsession.rs
+++ b/components/script/dom/xrsession.rs
@@ -288,6 +288,14 @@ impl XRSessionMethods for XRSession {
.map(|x| DomRoot::from_ref(&**x))
.collect()
}
+
+ /// https://immersive-web.github.io/webxr/#dom-xrsession-end
+ fn End(&self) -> Rc<Promise> {
+ // XXXManishearth implement device disconnection and session ending
+ let p = Promise::new(&self.global());
+ p.resolve_native(&());
+ p
+ }
}
#[derive(Clone, Copy, Debug)]
diff --git a/components/script/dom/xrtest.rs b/components/script/dom/xrtest.rs
index 8049b9ffa41..3e695bc1f5e 100644
--- a/components/script/dom/xrtest.rs
+++ b/components/script/dom/xrtest.rs
@@ -170,4 +170,12 @@ impl XRTestMethods for XRTest {
// XXXManishearth actually check for activation in XRSession
let _ = f.Call__(vec![], ExceptionHandling::Rethrow);
}
+
+ /// https://github.com/immersive-web/webxr-test-api/blob/master/explainer.md
+ fn DisconnectAllDevices(&self) -> Rc<Promise> {
+ // XXXManishearth implement device disconnection and session ending
+ let p = Promise::new(&self.global());
+ p.resolve_native(&());
+ p
+ }
}