Gamepad API manual tests

Open the developer console to see test results. If you need to see the full gamepad state, use Hardware Tester

Gamepad.id

Not testable as the content is not fully specified, it's a known interop issue.

Gamepad.index and getGamepads()

How many items does getGamepads() return? Is the last item non-null?

Test the behavior when connecting and disconnecting gamepads

  1. Connect one gamepad → confirm its index is 0
  2. Connect another gamepad → confirm its index is 1
  3. Disconnect first gamepad → confirm getGamepads() returns an array with null at index 0
  4. Reconnect first gamepad → confirm index 0 is reused

Gamepad.connected and connection events

It should be true in the gamepadconnected listener, true in navigator.getGamepads(), false in the gamepaddisconnected listener.

Gamepad.timestamp

The timestamp is "current high resolution time" which is relative to the relevant settings object's time origin. According to the spec, the timestamp should be updated whenever new button or axis input values are received. Does the timestamp update for each report or only when values change?

Gamepad.mapping and button/axis ordering

The mapping should be "standard" for a well-known gamepad. Check that the axes length is 4 and the buttons length matches the expectation for that device. Check that each axis and button has the correct index

Xbox:
Playstation:
Switch:

GamepadButton.pressed

For a pressure-sensitive button like a trigger, at what value does the pressed attribute change to true?

GamepadButton.touched

Is the touched attribute always true when the pressed attribute is true?

For a pressure-sensitive button like a trigger, at what value does the touched attribute change to true?

GamepadTouch

Is touches populated for a touch-enabled device?

Test the behavior with adding and removing touches:

Can't test surfaceId (no supported devices with more than one surface)

GamepadHapticActuator

Is it non-null on gamepads with haptic capabilities?

Does the effects member exist?

Does effects include "dual-rumble"?

Xbox: Does effects include "trigger-rumble"?

GamepadEffectParameters

with duration 1000, strongMagnitude 1.0. Does it vibrate for about 1 second? Does it resolve with "complete"?

with strongMagnitude 1.0, then with weakMagnitude 1.0. Can you feel a difference between the strong and weak effects? Is the weak effect a higher frequency, less intense vibration?

with startDelay 1000 and duration 1000. Does it wait for about 1 second before vibrating?

with duration 5000, then with startDelay 1000. Does vibration stop for about 1 second before vibrating again?

"trigger-rumble"

with leftTrigger 1.0. Is it felt in the left trigger?

with rightTrigger 1.0. Is it felt in the right trigger?

GamepadHapticsResult

with duration 5000 and strongMagnitude 1.0, then with a second call to playEffect with duration 1000 and weakMagnitude 1.0.

Page visibility

Does the page still receive gamepad connection and disconnection events when hidden?

Is gamepad button/axis state observable when hidden?

Page refresh

Are previously connected gamepads still connected after a page refresh? Is a user gesture still needed?

Back-forward cache

When navigating to a cached page that previously had a gamepad user gesture, is the user gesture remembered? Are connected gamepads still connected?

Do gamepadconnected and gamepaddisconnected events fire for connection changes that occurred while the page was cached?

Gamepad user gesture

Are gamepads hidden before the first gamepad gesture? Does a button press count as a gesture? Does an axis movement count as a gesture? Does a touchpad input count as a gesture?

User activation

Is a gamepad button press counted as user activation for APIs that require user activation? Can fullscreen API trigger on a button press? Press the "start" button to try going fullscreen.