Documentation
¶
Overview ¶
Package hostconformance contains one application scenario shared by the terminal, browser, and window host conformance tests. Hosts provide only event delivery, settling, alert answers, and lifecycle observation.
Index ¶
Constants ¶
const ClipboardText = "host conformance clipboard"
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns the app and observer used by every host adapter. The scenario records Init/Resize ordering, one async fold, Alert and Exec answers, clipboard round-tripping, Ctrl+C delivery, Quit, and OnExit.
func Verify ¶
func Verify(adapter Adapter, want Expectations) error
Verify runs the same lifecycle, async, dialog, effect, clipboard, Quit, and Ctrl+C cases against an adapter. It returns a concrete failure message so tests in the root and nested window modules can share this suite.
Types ¶
type Driver ¶
type Driver interface {
Send(flatte.KeyEvent) error
AnswerAlert(button int) error
Wait(func(Snapshot) bool) error
Finished() bool
ClipboardWriteObserved() bool
Close()
}
Driver is the small surface a host adapter needs to expose to the shared conformance checks. Wait must keep driving queued host work while waiting.
type Expectations ¶
type Expectations struct {
Capabilities flatte.Capabilities
AlertButton int
AlertError string
ExecError string
ClipboardRead bool
ClipboardValue string
CtrlCDelivered bool
CtrlCExitsRun bool
}
Expectations captures deliberate host differences. Capabilities must be identical in Effects and RenderContext for each host.
type Observer ¶
type Observer struct {
OnExit func()
// contains filtered or unexported fields
}
Observer captures the RenderContext capabilities and allows executable browser smokes to mark OnExit in the DOM shim.
func (*Observer) RenderCapabilities ¶
func (o *Observer) RenderCapabilities() (flatte.Capabilities, bool)
RenderCapabilities returns the capabilities seen by View, once rendered.
type Snapshot ¶
type Snapshot struct {
Order []string
Keys []string
Initialized bool
Async bool
Width, Height int
AlertDone bool
AlertButton int
AlertError string
ExecDone bool
ExecError string
Clipboard string
CtrlC int
QuitRequested bool
Exited bool
Capabilities flatte.Capabilities
}
Snapshot is the app-owned result of the common host scenario.