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
- func CornerAlphas(root widget.Widget) [4]byte
- type Rig
- func (r *Rig) AssertNoToplevel(t *testing.T, appID string)
- func (r *Rig) AwaitNoToplevel(t *testing.T, appID string)
- func (r *Rig) AwaitOtherFocused(t *testing.T)
- func (r *Rig) AwaitParented(t *testing.T, appID string)
- func (r *Rig) CloseOwner(t *testing.T)
- func (r *Rig) MapOther(t *testing.T) (focused func() bool)
- func (r *Rig) ResizeBy(t *testing.T, appID string, dx, dy int)
Constants ¶
const (
OwnerAppID = "org.example.Owner"
)
The app ids of the windows the rig maps.
Variables ¶
This section is empty.
Functions ¶
func CornerAlphas ¶ added in v0.3.26
CornerAlphas lays root out at its natural size, paints it, and returns the alpha of its four corner pixels, top left first and clockwise: all opaque for a dialog filling its window, translucent where a floating card rounds off over its shadow.
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 ¶
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 ¶
AssertNoToplevel fails the test if a toplevel of appID shows: the dialog is an overlay.
func (*Rig) AwaitNoToplevel ¶
AwaitNoToplevel waits until no toplevel of appID shows: the dialog moved to the overlay.
func (*Rig) AwaitOtherFocused ¶
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 ¶
AwaitParented waits until lys-wm shows a toplevel of appID transient for the owner window and on its output.
func (*Rig) CloseOwner ¶
CloseOwner ends the owner window's app.
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. |