Documentation
¶
Overview ¶
Package treetest walks lys-ui widget trees for the shell's surface tests: find the button a user would click, read what the labels say.
Index ¶
- Constants
- Variables
- func All[T widget.Widget](root widget.Widget) []T
- func Button(t *testing.T, root widget.Widget, name string) *widget.Button
- func First[T widget.Widget](t *testing.T, root widget.Widget) T
- func Font(t *testing.T) render.Font
- func IconTheme(t *testing.T, names ...string)
- func Ink(w widget.Widget) int
- func Labels(root widget.Widget) []string
- func Walk(w widget.Widget, visit func(widget.Widget))
- func WithClass(root widget.Widget, class string) []widget.Widget
Constants ¶
const Liveness = 10 * time.Second
Liveness is how long a surface harness waits for a surface to open or a request to be answered before failing: a guard against a hang, not a speed bound. The first surface of a test binary compiles the whole stylesheet bundle, which the race detector under a parallel test run stretches past a couple of seconds.
Variables ¶
var Loop sync.Mutex
Loop stands in for the process's one UI goroutine in the surface harnesses: lys-ui keeps its style and layout scratch per process, so every harness in a test binary runs its widget work under this one lock, never a lock of its own (a finished test's harness can still be draining while the next one builds).
Functions ¶
func IconTheme ¶
IconTheme points theme icon lookups at a temp hicolor theme holding one solid square SVG app icon per name, for the duration of the test.
Types ¶
This section is empty.