Expand description
Testing a framework app the way it runs: the real component runtime, storage, permissions, undo and history, without a window.
Prefer tilo_resource::Replica for the resource’s own behaviour (it
needs no UI). Use TestApp to prove what the host adds: that controls
invoke actions, that undo reverts them, that a viewer is refused, that
state survives a reopen.
Structs§
- Headless
App - One framework app mounted headlessly: a test, a fixture seeder or an inspection tool drives it through the real runtime.
Functions§
- detached_
dispatcher - A dispatcher outside any host, for a unit test of a surface (or of the
model behind it) that edits through one: each immediate action
([
Dispatcher::apply_now]) applies to the document handed to it, attributed toauthor, through the same executor as a hosted one, so the test exercises the surface’s real write path. Queued invocations ([Dispatcher::apply]) are not taken by anyone: drive those throughTestApp. - detached_
live - The live state of
doc, for a surface a unit test attaches outside any host (seedetached_dispatcher); the surface keeps it current from the document itssyncreceives, as in a host. - dispatcher
- A dispatcher of
Rfor testing a surface’s own methods without a host: the edits it applies now ([Dispatcher::apply_now]) go through the same replayable executor a hosted surface’s do, attributed to a test author, onto the document the test hands the surface. Invocations it queues are resolved by a host only; test those throughTestApp. - drive_
live_ embedded drive_live_windowwith the window shown in a region of a host’s scene, as the shell shows an in-process app: the real app in aui_core::app::EmbeddedApp, which the drive lays out, draws into its own scene and feeds input through [ui_core::app::EmbeddedApp::input_for_test].- drive_
live_ window - Drive the window
A’s live launch opens, mounted asinspect_live_windowmounts it: the realui_core::App, which a test or benchmark feeds input throughui_core::App::surface_input. - inspect_
live_ window - Inspect the window
A’s live launch opens: the same definition and component, mounted in a nativeui_core::Appon a fresh private profile, without running its event loop. For what the window itself declares, such as capture protection. - resolve
- Resolve what
dispatcher(dispatcher) queued since the last call — its actions, typed values and groups — ontodocas a host does after an event, as confirmed: each invocation one step, attributed to the test author. An action its resource refuses (its clip is gone) changes nothing and is reported through [Dispatcher::refused], as the host reports it. Returns what each applied invocation applied, in order: one entry per undo step (a group’s entry holds all of its actions). - search_
source - The search source the framework builds for
Rfromentries— its resource’s and its surfaces’ — for testing what an app’s entries find and how their hits read without a window. - surface_
in - The custom surface of type
SthatA’s view hosts inharness, without running a frame (seewith_surface). - surface_
in_ root - The custom surface of type
SthatA’s view hosts, whenwidgetisA’s root as a host mounted it: a tab ofAin a shell, found in the host’s own widget map. - surface_
report - What
Apublishes and how its view binds to it, astilo-app surfacecommits it andtilo-app checkcompares it: the resource’sSurfaceand those of the person’s records its views open, every control its view, built headless on an empty record, binds to something the resource does not publish, the ids of its effects and named views, and the ids the framework keeps for its own actions (reserved_action_ids). - window_
record - The record window
instanceofAkept in the test room whileAkept one per window: stamped with that window’s default identity, initialized asAcreates a record, then edited withactions. Open the app over such records withHeadlessApp::with_window_records. - with_
surface - Run
visiton the custom surface of typeSthatA’s view hosts inharness(whatViewCx::surfacemounted), then the frames that follow;Nonewhen the view hosts no such surface at its root. For a test that drives a component mounted another way thanHeadlessApp(two windows over one record).
Type Aliases§
- TestApp
- The name tests use for
HeadlessApp.