Improve session test lifecycle code

This commit is contained in:
Manish Goregaokar 2019-07-23 13:33:47 -07:00
parent 518a55c80a
commit d996d3c1eb
4 changed files with 39 additions and 8 deletions

View file

@ -178,9 +178,7 @@ impl XRTestMethods for XRTest {
let mut rooted_devices: Vec<_> =
devices.iter().map(|x| DomRoot::from_ref(&**x)).collect();
devices.clear();
for device in rooted_devices.drain(..) {
device.disconnect(sender.clone());
}
let mut trusted = Some(TrustedPromise::new(p.clone()));
let (task_source, canceller) = global
.as_window()
@ -201,9 +199,9 @@ impl XRTestMethods for XRTest {
}),
);
// XXXManishearth this is a hack, it will need to be replaced when
// we improve how mock messaging works
p.resolve_native(&())
for device in rooted_devices.drain(..) {
device.disconnect(sender.clone());
}
};
p
}