mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Allow simulating multiple immersive-capable devices
This commit is contained in:
parent
8aaa8493a7
commit
d46cbb2083
1 changed files with 0 additions and 10 deletions
|
@ -25,14 +25,12 @@ use euclid::RigidTransform3D;
|
|||
use ipc_channel::ipc::IpcSender;
|
||||
use ipc_channel::router::ROUTER;
|
||||
use profile_traits::ipc;
|
||||
use std::cell::Cell;
|
||||
use std::rc::Rc;
|
||||
use webxr_api::{self, Error as XRError, MockDeviceInit, MockDeviceMsg};
|
||||
|
||||
#[dom_struct]
|
||||
pub struct XRTest {
|
||||
reflector: Reflector,
|
||||
session_started: Cell<bool>,
|
||||
devices_connected: DomRefCell<Vec<Dom<FakeXRDevice>>>,
|
||||
}
|
||||
|
||||
|
@ -40,7 +38,6 @@ impl XRTest {
|
|||
pub fn new_inherited() -> XRTest {
|
||||
XRTest {
|
||||
reflector: Reflector::new(),
|
||||
session_started: Cell::new(false),
|
||||
devices_connected: DomRefCell::new(vec![]),
|
||||
}
|
||||
}
|
||||
|
@ -76,11 +73,6 @@ impl XRTestMethods for XRTest {
|
|||
fn SimulateDeviceConnection(&self, init: &FakeXRDeviceInit) -> Rc<Promise> {
|
||||
let p = Promise::new(&self.global());
|
||||
|
||||
if !init.supportsImmersive || self.session_started.get() {
|
||||
p.reject_native(&());
|
||||
return p;
|
||||
}
|
||||
|
||||
let origin = if let Some(ref o) = init.viewerOrigin {
|
||||
match get_origin(&o) {
|
||||
Ok(origin) => origin,
|
||||
|
@ -121,8 +113,6 @@ impl XRTestMethods for XRTest {
|
|||
floor_origin,
|
||||
};
|
||||
|
||||
self.session_started.set(true);
|
||||
|
||||
let global = self.global();
|
||||
let window = global.as_window();
|
||||
let this = Trusted::new(self);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue