This test exercises the touch input dispatch path from Input Pipeline to a Scenic client. It is a multi-component test, and carefully avoids polling for component coordination.
starnix-touch-test.cc: Instantiates the component hierarchy, injects touch events, reads back events from the evdev
client running under Starnix
Scene Manager: Unmodified Fuchsia component; also referred to as Input Pipeline, for its role in routing input events
Scenic: Unmodified Fuchsia component
Starnix
debian_realm: The root of the Starnix subtree within the component hierarchy. Instantiates the Starnix kernel and the debian_container
, and sets up the starnix_kernel_env
needed for the Starnix kernel to be the runner for debian_container
.
All of this machinery lets us run software from a Debian image. For details of which image is used, see the debian_container_component
target in ui-client/BUILD.gn.
This test uses the Debian image, because it's readily available in the Fuchsia tree. However, the test does not have any specific dependency on Debian, beyond the fact that Debian provides .so
files needed to run a Linux C++ program.
In particular, the test does not depend on, e.g., daemons in Debian that create device nodes in response to udev
events.
debian_container: The Linux userspace that is run by the Starnix kernel. This provides a shell environment (e.g. /bin/sh
), runs the launch_input
program to initialize Starnix input, and runs the touch_dump
program to relay evdev
data back to starnix-touch-test.cc
.
launch_input: This program triggers the initialization of Starnix input.
framebuffer
feature, launch_input
forces Starnix to initialize its input code.framebuffer
feature is associated with a kernel, rather than with components running under Starnix, this program can go away.touch_dump: The evdev
client. This reads touch events from /dev/input/event0
, parses the struct input_event
records read from that device, and prints them out in a simple text format.
starnix-touch-test.cc
-> Input Pipeline -> Scenic -> Starnix kernel -> touch_dumpstarnix-touch-test.cc
sets up this view hierarchy:starnix-touch-test.cc
waits for a Scenic event that verifies Starnix has UI content in the scene graph.starnix-touch-test.cc
injects input into Input Pipeline, emulating a display's touch report.touch-dump.cc
reads the event from the Starnix kernel using the evdev
protocol.touch-dump.cc
reports the event details back to starnix-touch-test.cc
over a Zircon datagram socket.starnix-touch-test.cc
validates the contents of the event.Here are some of the capability routes configured in this test. This is by no means comprehensive. It just focuses on the routes that are apparent from the source code in this directory.
The input devices will be present in the container by the time Linux code is running. The input handling threads will also have been spawned before init runs.
$ fx set core.x64 --with //src/ui/tests/integration_input_tests/starnix-touch:tests
To run the fully-automated test, use this fx invocation:
$ fx test starnix-touch-test