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.
Nothing here is reached from an app binary’s own modes: those use
super::headless, so a release app carries none of this module.
Re-exports§
pub use super::headless::HeadlessApp;pub use super::headless::HostedApp;pub use super::headless::surface_in;
Constants§
- SIDEBAR_
BUTTON_ WINDOWS - The windows
check_window_sidebar_buttonopens an app in: one wide enough to dock a sidebar beside any content, and one so narrow the sidebar is a screen of its own or a drawer over the content.
Functions§
- check_
window_ sidebar_ button - Open the app with
openin each ofSIDEBAR_BUTTON_WINDOWS, shown in the desktop’s window bar, and click the bar’s sidebar button three times there: every click flips the sidebar, on the bar, in the window’s shell and on screen (FrameHarness::check_window_sidebar_button). - 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 throughui_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. - drive_
live_ window_ writing_ after drive_live_window, with the window’s record writtendebounceafter the last edit instead of the window’s own [app_state::DEFAULT_DEBOUNCE]. The store writes on a thread of its own and wakes the window when the write lands, so whether a frame observed while typing takes that wake depends on how long the frames before it took. A debounce longer than the test holds every write past what it observes.- 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 throughDispatcher::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_ 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. - window_
record - The record window
instanceofAkept in the test workspace 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.