LibWeb: Add tests for Gamepad API by utilising virtual SDL3 joysticks
Some checks failed
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Build Dev Container Image / build (push) Has been cancelled

This commit is contained in:
Luke Wilde 2025-08-18 17:28:06 +01:00 committed by Andreas Kling
commit 9adf27f009
Notes: github-actions[bot] 2025-09-01 19:11:51 +00:00
28 changed files with 897 additions and 0 deletions

View file

@ -18,6 +18,7 @@
#include <LibWeb/DOMURL/DOMURL.h>
#include <LibWeb/HTML/HTMLElement.h>
#include <LibWeb/HTML/Window.h>
#include <LibWeb/Internals/InternalGamepad.h>
#include <LibWeb/Internals/Internals.h>
#include <LibWeb/Page/InputEvent.h>
#include <LibWeb/Page/Page.h>
@ -330,4 +331,15 @@ GC::Ptr<DOM::ShadowRoot> Internals::get_shadow_root(GC::Ref<DOM::Element> elemen
return element->shadow_root();
}
void Internals::handle_sdl_input_events()
{
page().handle_sdl_input_events();
}
GC::Ref<InternalGamepad> Internals::connect_virtual_gamepad()
{
auto& realm = this->realm();
return realm.create<InternalGamepad>(realm);
}
}