mutter/src/tests
Jonas Ådahl 79e1fc63ad tests: Add service door Wayland test case
Checks that the MetaWaylandClient from the service door is the one
owning the client connection opened via the D-Bus interface.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
..
clutter tests/clutter/event-delivery: Add tests for implicit grabbing 2023-02-03 12:10:22 +00:00
cogl tests/cogl: Remove extra semicolon 2023-02-01 08:40:53 +01:00
dbusmock-templates
icc-profiles
kvm tests/kvm: Run with 1GB RAM 2023-01-21 14:22:33 +01:00
meta-test tests: Add public test monitor API 2023-02-03 15:29:28 +00:00
migration
monitor-configs
protocol wayland: Add wl_global filter manager 2023-02-13 15:34:24 +00:00
ref-tests
share/icc
stacking tests/stacking: Change primary monitor handling 2023-02-07 17:52:19 +01:00
wayland-test-clients tests: Add service door Wayland test case 2023-02-13 15:34:24 +00:00
anonymous-file.c
boxes-tests.c
boxes-tests.h
clutter-test-utils.c tests/clutter: Use a dummy actor for some interactive tests 2023-01-30 13:17:19 +00:00
clutter-test-utils.h tests/clutter: Use a dummy actor for some interactive tests 2023-01-30 13:17:19 +00:00
cogl-test-utils.c
cogl-test-utils.h
color-management-profile-conflict-test.c tests/meta-context-test: Free D-Bus call results 2023-02-01 13:16:29 +00:00
color-management-tests.c tests/color: Assert we saw the expected messages 2023-01-24 13:09:42 +00:00
edid-tests.c
headless-start-test.c tests: Make tests components have ownership chains as well 2022-12-17 15:13:48 +01:00
kms-utils-unit-tests.c
meson.build tests: Add service door Wayland test case 2023-02-13 15:34:24 +00:00
meta-backend-test.c clutter: Pass 'ClutterFrame' in all stage update signals 2023-01-23 15:57:50 +01:00
meta-backend-test.h
meta-context-test.c tests/stacking: Test stacking order with raise-on-click = false 2023-02-07 15:40:08 +01:00
meta-dbus-runner.py
meta-gpu-test.c
meta-gpu-test.h backend: Move GPU ownership from the monitor manager to the backend 2019-06-20 13:31:55 +00:00
meta-kms-test-utils.c
meta-kms-test-utils.h
meta-monitor-manager-test.c tests: Make tests components have ownership chains as well 2022-12-17 15:13:48 +01:00
meta-monitor-manager-test.h
meta-monitor-test-utils.c backend: Set up and use ownership chains 2022-12-17 13:52:51 +00:00
meta-monitor-test-utils.h
meta-ref-test.c tests/ref-test: Don't use gidoc for private function 2023-02-03 15:29:28 +00:00
meta-ref-test.h
meta-sensors-proxy-mock.c
meta-sensors-proxy-mock.h
meta-test-monitor.c tests: Add public test monitor API 2023-02-03 15:29:28 +00:00
meta-test-utils-private.h
meta-test-utils.c Always queue MetaLater via compositor instance 2022-12-17 15:13:48 +01:00
meta-test-utils.h tests/utils: Add helper to flush the input thread 2022-12-13 18:31:14 +00:00
meta-wayland-test-driver.c clutter: Pass 'ClutterFrame' in all stage update signals 2023-01-23 15:57:50 +01:00
meta-wayland-test-driver.h
meta-wayland-test-utils.c tests/wayland-test-utils: Add helper to wait for window 2023-02-13 15:34:24 +00:00
meta-wayland-test-utils.h tests/wayland-test-utils: Add helper to wait for window 2023-02-13 15:34:24 +00:00
monitor-config-migration-unit-tests.c tests: Make tests components have ownership chains as well 2022-12-17 15:13:48 +01:00
monitor-config-migration-unit-tests.h
monitor-store-unit-tests.c tests: Make tests components have ownership chains as well 2022-12-17 15:13:48 +01:00
monitor-store-unit-tests.h
monitor-transform-tests.c
monitor-transform-tests.h
monitor-unit-tests.c Always queue MetaLater via compositor instance 2022-12-17 15:13:48 +01:00
monitor-util-tests.c
mutter_dbusrunner.py
mutter-installed-dbus-session.py.in
native-headless.c tests: Make tests components have ownership chains as well 2022-12-17 15:13:48 +01:00
native-kms-device.c
native-kms-force-atomic-sanity.c
native-kms-force-simple-sanity.c
native-kms-render.c clutter: Pass 'ClutterFrame' in all stage update signals 2023-01-23 15:57:50 +01:00
native-kms-updates.c
native-persistent-virtual-monitor.c tests: Make tests components have ownership chains as well 2022-12-17 15:13:48 +01:00
native-pointer-constraints.c tests/native-pointer-constraints: Remove extra semicolon 2023-02-01 08:40:53 +01:00
native-screen-cast.c tests/screen-cast: Enable 'screen-cast' debug topic 2022-12-13 18:31:14 +00:00
native-screen-cast.h
native-virtual-monitor.c tests: Make tests components have ownership chains as well 2022-12-17 15:13:48 +01:00
native-virtual-monitor.h tests: Make tests components have ownership chains as well 2022-12-17 15:13:48 +01:00
orientation-manager-unit-tests.c
orientation-manager-unit-tests.h
README
ref-test-sanity.c tests: Make tests components have ownership chains as well 2022-12-17 15:13:48 +01:00
screen-cast-client.c tests/screen-cast: Add debug logs to screen cast client 2022-12-13 18:31:14 +00:00
service-channel-tests.c tests: Add service door Wayland test case 2023-02-13 15:34:24 +00:00
stacking.test.in tests: Break up stacking installed-tests into more, smaller tests 2023-01-30 14:39:39 +00:00
stage-view-tests.c clutter: Pass 'ClutterFrame' in all stage update signals 2023-01-23 15:57:50 +01:00
test-client.c core: Add a copy of GDK_PRIORITY_EVENTS 2022-12-22 15:13:54 +01:00
test-runner.c tests/stacking: Change primary monitor handling 2023-02-07 17:52:19 +01:00
unit-tests.c Always queue MetaLater via compositor instance 2022-12-17 15:13:48 +01:00
unit-tests.h
wayland-client-tests.c tests: Add MetaWaylandClient test cases 2023-02-13 15:34:24 +00:00
wayland-fullscreen-test.c tests: Make tests components have ownership chains as well 2022-12-17 15:13:48 +01:00
wayland-unit-tests.c tests/wayland: Move out window finder helper to helper file 2023-02-13 15:34:24 +00:00
x11-test.sh
xwayland-tests.c display: Freeze stack when closing X11 display 2022-11-21 16:30:06 +00:00

This directory implements a framework for automated tests of Mutter. The basic
idea is that mutter-test-runner acts as the window manager and compositor, and
forks off instances of mutter-test-client to act as clients.

There's a simple scripting language for tests. A very small test would look like:

---
# Start up a new X11 client with the client id 1 (doesn't have to be an integer)
# Windows for this client will be referred to as 1/<window-id>
new_client 1 x11

# Create and show two windows - again the IDs don't have to be integers
create 1/1
show 1/1
create 1/2
show 1/2

# Wait for the commands we've executed in the clients to reach Mutter
wait

# Check that the windows are in the order we expect
assert_stacking 1/1 1/2
---

Running
=======

The tests are installed according to:

https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests

if -Dtests=true is passed to `meson configure`. You can run them uninstalled with:

 ninja test

Command reference
=================

The following commands are supported. Quoting and comments follow shell rules.

new_client <client-id> [wayland|x11]
 Starts a client, connecting by either Wayland or X11. The client
 will subsequently be known with the given client-id (an arbitrary
 string)

quit_client <client-id>
 Destroys all windows for the client, waits for that to be processed,
 then instructs the client to exit.

create <client-id>/<window-id> [override|csd]
 Creates a new window. For the X11 backend, the keyword 'override'
 can be given to create an override-redirect and the keyword 'csd'
 can be given to create a client-side decorated window.

show <client-id>/<window-id>
hide <client-id>/<window-id>
 Ask the client to show (map) or hide (unmap) the given window

activate <client-id>/<window-id>
 Ask the client to raise and focus the given window. This is currently a no-op
 for Wayland, where this capability is not supported in the protocol.

local_activate <client-id>-<window-id>
  The same as 'activate', but the operation is done directly inside Mutter
  and works for both backends

raise <client-id>/<window-id>
lower <client-id>/<window-id>
  Ask the client to raise or lower the given window ID. This is a no-op
  for Wayland clients. (It's also considered discouraged, but supported, for
  non-override-redirect X11 clients.)

minimize <client-id>/<window-id>
unminimize <client-id>/<window-id>
  Ask the client to minimize or unminimize the given window ID. This older
  term for this operation is "iconify".

destroy <client-id>/<window-id>
  Destroy the given window

wait
  Wait until all requests sent by Mutter to clients have been received by Mutter,
  and then wait until all requests by Mutter have been processed by the X server.

assert_stacking <client-id>/<window-id> <client-id>/<window-id> ...
  Assert that the list of client windows known to Mutter is as given and in
  the given order, bottom to top. The character '|' can be present in the
  list of windows to indicate the guard window that separates hidden and
  visible windows. If '|' isn't present, the guard window is asserted to
  be below all client windows.

  This function also queries the X server stack and verifies that Mutter's
  expectation of the X server stack matches reality.