1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/.
5 * This WebIDL is just for WebVR testing.
8 [Pref="dom.vr.puppet.enabled",
9 HeaderFile="mozilla/dom/VRServiceTest.h",
11 interface VRMockDisplay {
13 attribute boolean capPosition;
14 attribute boolean capOrientation;
15 attribute boolean capPresent;
16 attribute boolean capExternal;
17 attribute boolean capAngularAcceleration;
18 attribute boolean capLinearAcceleration;
19 attribute boolean capStageParameters;
20 attribute boolean capMountDetection;
21 attribute boolean capPositionEmulated;
22 undefined setEyeFOV(VREye eye,
23 double upDegree, double rightDegree,
24 double downDegree, double leftDegree);
25 undefined setEyeOffset(VREye eye, double offsetX,
26 double offsetY, double offsetZ);
27 undefined setEyeResolution(unsigned long renderWidth,
28 unsigned long renderHeight);
29 undefined setConnected(boolean connected);
30 undefined setMounted(boolean mounted);
31 undefined setStageSize(double width, double height);
32 [Throws] undefined setSittingToStandingTransform(Float32Array sittingToStandingTransform);
33 [Throws] undefined setPose(Float32Array? position, Float32Array? linearVelocity,
34 Float32Array? linearAcceleration, Float32Array? orientation,
35 Float32Array? angularVelocity, Float32Array? angularAcceleration);
38 [Pref="dom.vr.puppet.enabled",
39 HeaderFile="mozilla/dom/VRServiceTest.h",
41 interface VRMockController {
44 attribute GamepadHand hand;
45 attribute boolean capPosition;
46 attribute boolean capOrientation;
47 attribute boolean capAngularAcceleration;
48 attribute boolean capLinearAcceleration;
49 attribute unsigned long axisCount;
50 attribute unsigned long buttonCount;
51 attribute unsigned long hapticCount;
52 [Throws] undefined setPose(Float32Array? position, Float32Array? linearVelocity,
53 Float32Array? linearAcceleration, Float32Array? orientation,
54 Float32Array? angularVelocity, Float32Array? angularAcceleration);
55 undefined setButtonPressed(unsigned long buttonIdx, boolean pressed);
56 undefined setButtonTouched(unsigned long buttonIdx, boolean touched);
57 undefined setButtonTrigger(unsigned long buttonIdx, double trigger);
58 undefined setAxisValue(unsigned long axisIdx, double value);
61 [Pref="dom.vr.puppet.enabled",
62 HeaderFile="mozilla/dom/VRServiceTest.h",
64 interface VRServiceTest {
65 VRMockDisplay getVRDisplay();
66 [Throws] VRMockController getVRController(unsigned long controllerIdx);
67 [NewObject] Promise<undefined> run();
68 [NewObject] Promise<undefined> reset();
72 undefined timeout(unsigned long duration);
73 undefined wait(unsigned long duration);
74 undefined waitSubmit();
75 undefined waitPresentationStart();
76 undefined waitPresentationEnd();
78 undefined waitHapticIntensity(unsigned long controllerIdx, unsigned long hapticIdx, double intensity);
79 undefined captureFrame();
80 undefined acknowledgeFrame();
81 undefined rejectFrame();
82 undefined startTimer();
83 undefined stopTimer();