Gamepad API automated testing by the Virtual Gamepad Control

Open
#1,454 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript
Domain
api, game-dev, testing

Research direction

The issue describes a multi-quarter roadmap for implementing a virtual gamepad control for automated WPT tests. Start by reading the linked proposal at https://github.com/xingri/xingri.github.io/blob/master/gamepad-interop/proposal-2027.md and the previous interop efforts. The work involves designing and implementing a new automation interface that integrates with WebDriver's Actions input source. 'Done' means a working prototype in WebKit and Chromium and a foundational test suite.

Written by the indexing model from the issue text.

Description

investigation-effort-proposal
Description

This proposal seeks to continue the investigation into automated testing for the Gamepad API, building on the Virtual Gamepad Control framework. Previous efforts in 2025 defined initial testing processes. While the 2026 Interop proposal was not accepted, working group discussions identified detailed requirements for Gamepad API automation. We now propose a concrete implementation through collaboration with browser teams to establish a foundational test suite.

Tasks:

  • Allow a WPT to create a virtual gamepad with controlled static properties and a browsing-context scope.
  • Model gamepad input as an Actions input source, so it composes with other WebDriver input sources and has explicit tick ordering.
  • Support axes, buttons (including independent pressed/touched sensors), touch surfaces, and advertised vibration effects in the device description.
  • Allow a WPT to disconnect the gamepad and clean it up.
Rationale

The Gamepad API is an essential input mode for web gaming applications – critically important for platforms like NVIDIA GeForce NOW Cloud Gaming and, indeed, for the player experience. Because browser architectures are constantly evolving, regressions can still slip through on APIs that major production platforms rely on daily. This underscores the urgent need for robust automated testing.

Currently, the lack of such testing presents a significant challenge. Most gamepad behavior relies on manual testing due to the API’s inability to natively connect a gamepad or generate realistic axis and button input. While existing browser test infrastructure utilizes mock-gamepad implementations, these are typically tied to engine-specific test APIs – limiting them primarily to unit testing.

Recent Gamepad Issues:

We are proposing to implement portable, automated WPT coverage for critical aspects such as gamepad connection/disconnection, input values, timestamps, visibility, user activation, and haptics, directly addressing real-world use cases. Tracking a concerning regression in WebKit and Chromium projects regarding this space, we believe that adopting automated tests will significantly reduce the likelihood of future issues.

Investigation Roadmap

Timeline:
Q1–Q2 2027: WebKit & Chromium Implement automation interfaces and create initial automated tests.
Q3 2027: Validate tests across major browsers; refine based on feedback.
Q4 2027: Document remaining gaps and ambiguities; prepare for potential future focus area proposal.

Detailed plan:

Dominant language
JavaScript
Stars
591
Forks
39
Avg merge
3h 8m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from web-platform-tests/interop

All issues in web-platform-tests/interop

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.