Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable XR WPT tests #23786

Merged
merged 7 commits into from Jul 17, 2019
Merged

Add stubs for session start/end

  • Loading branch information
Manishearth committed Jul 17, 2019
commit ffc943fec7cda035d4dacdec044409686e90bb86
@@ -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;
@@ -16,7 +16,7 @@ interface XRTest {
void simulateUserActivation(Function f);

// // Disconnect all fake devices
// Promise<void> disconnectAllDevices();
Promise<void> disconnectAllDevices();
};

dictionary FakeXRDeviceInit {
@@ -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)]
@@ -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
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.