aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/xr.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2019-05-29 13:55:56 -0700
committerManish Goregaokar <manishsmail@gmail.com>2019-05-30 13:29:05 -0700
commitc689866d3545c5adadcdbf19362894faf52d660e (patch)
tree9f55a5f7dbd677dfc66aa20de27b9e96aa4c9f9e /components/script/dom/xr.rs
parent422faddedf5a1166b78a295ee4235436cafc5491 (diff)
downloadservo-c689866d3545c5adadcdbf19362894faf52d660e.tar.gz
servo-c689866d3545c5adadcdbf19362894faf52d660e.zip
Add XR.test()
Diffstat (limited to 'components/script/dom/xr.rs')
-rw-r--r--components/script/dom/xr.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/components/script/dom/xr.rs b/components/script/dom/xr.rs
index 3ff67b0042c..1626ad4e00e 100644
--- a/components/script/dom/xr.rs
+++ b/components/script/dom/xr.rs
@@ -21,6 +21,7 @@ use crate::dom::promise::Promise;
use crate::dom::vrdisplay::VRDisplay;
use crate::dom::vrdisplayevent::VRDisplayEvent;
use crate::dom::xrsession::XRSession;
+use crate::dom::xrtest::XRTest;
use dom_struct::dom_struct;
use ipc_channel::ipc::IpcSender;
use profile_traits::ipc;
@@ -36,6 +37,7 @@ pub struct XR {
gamepads: DomRefCell<Vec<Dom<Gamepad>>>,
pending_immersive_session: Cell<bool>,
active_immersive_session: MutNullableDom<VRDisplay>,
+ test: MutNullableDom<XRTest>,
}
impl XR {
@@ -46,6 +48,7 @@ impl XR {
gamepads: DomRefCell::new(Vec::new()),
pending_immersive_session: Cell::new(false),
active_immersive_session: Default::default(),
+ test: Default::default(),
}
}
@@ -141,6 +144,11 @@ impl XRMethods for XR {
session.xr_present(promise.clone());
promise
}
+
+ // https://github.com/immersive-web/webxr-test-api/blob/master/explainer.md
+ fn Test(&self) -> DomRoot<XRTest> {
+ self.test.or_init(|| XRTest::new(&self.global()))
+ }
}
impl XR {