Backed out changeset 06f41c22f3a6 (bug 1888460) for causing linux xpcshell failures...
[gecko.git] / dom / webidl / GamepadServiceTest.webidl
blobdd8ae2144fcd85721799a651420ce97e5bbde095
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 [Pref="dom.gamepad.test.enabled",
6  Exposed=Window]
7 interface GamepadServiceTest
9   readonly attribute GamepadMappingType noMapping;
10   readonly attribute GamepadMappingType standardMapping;
11   readonly attribute GamepadHand noHand;
12   readonly attribute GamepadHand leftHand;
13   readonly attribute GamepadHand rightHand;
15   [NewObject]
16   Promise<unsigned long> addGamepad(DOMString id,
17                                     GamepadMappingType mapping,
18                                     GamepadHand hand,
19                                     unsigned long numButtons,
20                                     unsigned long numAxes,
21                                     unsigned long numHaptics,
22                                     unsigned long numLightIndicator,
23                                     unsigned long numTouchEvents);
25   [NewObject]
26   Promise<unsigned long> removeGamepad(unsigned long index);
28   [NewObject]
29   Promise<unsigned long> newButtonEvent(unsigned long index,
30                       unsigned long button,
31                       boolean pressed,
32                       boolean touched);
34   [NewObject]
35   Promise<unsigned long> newButtonValueEvent(unsigned long index,
36                                              unsigned long button,
37                                              boolean pressed,
38                                              boolean touched,
39                                              double value);
41   [NewObject]
42   Promise<unsigned long> newAxisMoveEvent(unsigned long index,
43                         unsigned long axis,
44                         double value);
45   [NewObject]
46   Promise<unsigned long> newPoseMove(unsigned long index,
47                    Float32Array? orient,
48                    Float32Array? pos,
49                    Float32Array? angVelocity,
50                    Float32Array? angAcceleration,
51                    Float32Array? linVelocity,
52                    Float32Array? linAcceleration);
54   [NewObject]
55   Promise<unsigned long> newTouch(unsigned long index, unsigned long aTouchArrayIndex,
56                 unsigned long touchId, octet surfaceId,
57                 Float32Array position, Float32Array? surfaceDimension);