Repository navigation
Description
Parent: #14
Dependencies
-
feat(wasm-example): add one-module async Tauri screenshot sketch and CLI #20 — one-module async Tauri screenshot sketch and CLI (required before this end-to-end proof)
-
feat(wasm): establish threaded sketch build, import validation, and lifecycle substrate #15 — threaded sketch build, import validation, and lifecycle substrate
-
feat(wasm): add generated async kernel ABI and generation-safe resources #16 — generated async kernel ABI and generation-safe resources
-
feat(wasm): add bounded opaque blobs and exact-output file capability #17 — bounded opaque blobs and exact-output file capability
-
feat(tauri): add a private async capture-only webview capability #18 — private async capture-only webview capability
-
feat(tauri): add private native viewport-PNG capture adapters #19 — private native viewport-PNG capture adapters
Purpose
Prove #14 end to end against a real native webview and actual compiled Wasm guest. This acceptance layer must not be made green with mocks, native duplicate guest logic, WebDriver, JavaScript capture, or desktop screenshots.
Scope
Add a focused integration harness that:
- Starts an offline loopback HTTP fixture with deterministic HTML, a fixed logical viewport-oriented color pattern, and a load-completion marker.
- Builds/uses the actual guest module and launches
kernal-api-wasm-taurias a child process. - Supplies fixture URL and temporary exact
.pngoutput path. - Records host timestamps for matching top-level load-finished and capture request.
- Decodes the output using portable Rust tooling; checks format, nonzero dimensions, tolerant expected color regions, and capture no earlier than 5.0 seconds after load-finished.
- Asserts process exit, webview close, Wasm teardown, and zero live kernel resources.
Cover malformed/non-HTTP(S) URL, disallowed redirect and popup, load timeout, native capture failure, unwritable output, guest trap, cancellation, and stale/cross-instance handles where exposed. Each must return a typed error, remove sibling temp output, leave no partial final PNG, and leak no window/task/guest thread/resource.
Non-goals
No mock runtime, fake screenshot backend, pixel-identical cross-engine hash, remote-network test, test-only ambient filesystem grant, or fixture direct Tauri navigation/capture.
Test design
The fixture may own the loopback server and observe structured trace events, but only CLI → Wasm guest → generated kernel ABI → private adapter performs UI work. Use fixed logical viewport/tolerant color regions because physical scaling and rendering vary by engine.
RED → GREEN acceptance criteria
- RED: the initial focused test invokes intended real CLI/guest path and fails before the async Tauri/snapshot ABI exists; preserve evidence in PR history instead of committed failing CI.
- GREEN: test invokes the produced guest module and proves no native duplicate orchestration ran.
- GREEN: an offline page loads in a real webview and capture is requested >=5.0 seconds after matching top-level finished load.
- GREEN: final output is a decodable viewport PNG with nonzero dimensions and expected tolerant color regions.
- GREEN: trace proves generated async ABI crossings and zero resources after success.
- GREEN: every listed failure gives typed error, removes temp output, leaves no partial final file, and releases windows/tasks/guest resources.
- GREEN: no path uses WebDriver, injected JS capture, desktop capture, mock runtime, or fixture direct Tauri calls.
Platform concerns
Run against real native webviews on Linux/macOS/Windows; Linux later uses xvfb and WebKitGTK 4.1. The existing Linux-only png dependency cannot unchanged serve all hosts; use portable decoder configuration. Avoid hard-coded physical dimensions/pixel hashes.
Deliverables
Offline fixture, child-process harness, portable PNG assertions, structured timing/resource trace checks, and explicit no-partial-file/no-leak negative tests.
Activity
zackees commentedon Sep 14, 2026
Completed by PR #153 (merge fddd176). The offline real-webview guest/CLI integration harness, timing/resource traces, decodable screenshot assertions, negative teardown cases, and native screenshot proof matrix landed.