surfacetest

package
v0.3.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package surfacetest runs a portal dialog host against a real lys-wm, with an app window it can be parented to, and reads back where lys-wm put the dialog. The app windows run in processes of their own (./probe), as real apps do, since a process runs one lys-ui loop.

Index

Constants

View Source
const (
	OwnerAppID = "org.example.Owner"
)

The app ids of the windows the rig maps.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rig

type Rig struct {
	// Shell runs the dialog host.
	Shell *app.Application
	// Parent is the owner window's parent_window, "wayland:<handle>".
	Parent string
	// contains filtered or unexported fields
}

Rig is a headless lys-wm with an app window exported for the dialogs to name, and the shell's application to show them from.

func Start

func Start(t *testing.T) *Rig

Start runs lys-wm headless, maps the owner window in a process of its own, and runs the shell's application, for the rest of the test.

func (*Rig) AssertNoToplevel

func (r *Rig) AssertNoToplevel(t *testing.T, appID string)

AssertNoToplevel fails the test if a toplevel of appID shows: the dialog is an overlay.

func (*Rig) AwaitNoToplevel

func (r *Rig) AwaitNoToplevel(t *testing.T, appID string)

AwaitNoToplevel waits until no toplevel of appID shows: the dialog moved to the overlay.

func (*Rig) AwaitOtherFocused

func (r *Rig) AwaitOtherFocused(t *testing.T)

AwaitOtherFocused maps one more app window, focuses it, and waits until it holds the keyboard: the dialog showing does not keep it.

func (*Rig) AwaitParented

func (r *Rig) AwaitParented(t *testing.T, appID string)

AwaitParented waits until lys-wm shows a toplevel of appID transient for the owner window and on its output.

func (*Rig) CloseOwner

func (r *Rig) CloseOwner(t *testing.T)

CloseOwner ends the owner window's app.

func (*Rig) MapOther

func (r *Rig) MapOther(t *testing.T) (focused func() bool)

MapOther maps one more app window in a process of its own, asks lys-wm to focus it as the user would, and returns whether it holds the keyboard focus.

Directories

Path Synopsis
Command probe maps one app window for surfacetest, in a process of its own as a real app's is, and reports on stdout the handle it is exported as ("handle <h>") and whether it holds the keyboard focus ("keyboard true|false"), each when it changes, until it is killed.
Command probe maps one app window for surfacetest, in a process of its own as a real app's is, and reports on stdout the handle it is exported as ("handle <h>") and whether it holds the keyboard focus ("keyboard true|false"), each when it changes, until it is killed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL