aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2019-07-16 15:06:02 -0700
committerManish Goregaokar <manishsmail@gmail.com>2019-07-16 22:17:05 -0700
commit73f1bdac06407f36db4511430df0b45f165eea91 (patch)
tree8e113d2105b9f52e5bcc2892ec538315807ad086
parentbd730e7c168b4e1c4ed8f37bfeb6db08a8fe873d (diff)
downloadservo-73f1bdac06407f36db4511430df0b45f165eea91.tar.gz
servo-73f1bdac06407f36db4511430df0b45f165eea91.zip
Add simulateUserActivation
-rw-r--r--components/script/dom/webidls/XRTest.webidl2
-rw-r--r--components/script/dom/xrtest.rs8
2 files changed, 9 insertions, 1 deletions
diff --git a/components/script/dom/webidls/XRTest.webidl b/components/script/dom/webidls/XRTest.webidl
index 1b1d131d562..89af1da991e 100644
--- a/components/script/dom/webidls/XRTest.webidl
+++ b/components/script/dom/webidls/XRTest.webidl
@@ -13,7 +13,7 @@ interface XRTest {
// // 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
// // Device API methods.
- // void simulateUserActivation(Function);
+ void simulateUserActivation(Function f);
// // Disconnect all fake devices
// Promise<void> disconnectAllDevices();
diff --git a/components/script/dom/xrtest.rs b/components/script/dom/xrtest.rs
index 6068a9a3e3a..8049b9ffa41 100644
--- a/components/script/dom/xrtest.rs
+++ b/components/script/dom/xrtest.rs
@@ -6,6 +6,8 @@
* 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/. */
+use crate::dom::bindings::callback::ExceptionHandling;
+use crate::dom::bindings::codegen::Bindings::FunctionBinding::Function;
use crate::dom::bindings::codegen::Bindings::XRTestBinding::{
self, FakeXRDeviceInit, XRTestMethods,
};
@@ -162,4 +164,10 @@ impl XRTestMethods for XRTest {
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);
+ }
}