Add simulateUserActivation

This commit is contained in:
Manish Goregaokar 2019-07-16 15:06:02 -07:00
parent bd730e7c16
commit 73f1bdac06
2 changed files with 9 additions and 1 deletions

View file

@ -13,7 +13,7 @@ interface XRTest {
// // Simulates a user activation (aka user gesture) for the current scope. // // Simulates a user activation (aka user gesture) for the current scope.
// // The activation is only guaranteed to be valid in the provided function and only applies to WebXR // // The activation is only guaranteed to be valid in the provided function and only applies to WebXR
// // Device API methods. // // Device API methods.
// void simulateUserActivation(Function); void simulateUserActivation(Function f);
// // Disconnect all fake devices // // Disconnect all fake devices
// Promise<void> disconnectAllDevices(); // Promise<void> disconnectAllDevices();

View file

@ -6,6 +6,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::callback::ExceptionHandling;
use crate::dom::bindings::codegen::Bindings::FunctionBinding::Function;
use crate::dom::bindings::codegen::Bindings::XRTestBinding::{ use crate::dom::bindings::codegen::Bindings::XRTestBinding::{
self, FakeXRDeviceInit, XRTestMethods, self, FakeXRDeviceInit, XRTestMethods,
}; };
@ -162,4 +164,10 @@ impl XRTestMethods for XRTest {
p p
} }
/// https://github.com/immersive-web/webxr-test-api/blob/master/explainer.md
fn SimulateUserActivation(&self, f: Rc<Function>) {
// XXXManishearth actually check for activation in XRSession
let _ = f.Call__(vec![], ExceptionHandling::Rethrow);
}
} }