Repository navigation
test(browser): smoke the annotation page hooks on macOS - #1702
Merged
Merged
Conversation
Drives evaluate, add_user_script, ScriptMessage and snapshot(region) in a hidden, unfocused BrowserTab against a local fixture page. Refs #832
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #832
Summary
Adds a macOS smoke example that drives the four browser page hooks from #832 on a real
BrowserTab:evaluate,add_user_script,BrowserEvent::ScriptMessage, andsnapshot(region). No runtime code changes.What changed and why
crates/ui/examples/browser_hooks_smoke.rs: new example. Serves a fixture page, registers a user script, evaluates JS, reads page messages, rejects an out-of-bounds snapshot, and writes the 120x72 PNG.Test evidence
cargo build --locked -p ui --example browser_hooks_smokeat 79a718a. No warnings.wezterm-guibefore and after.messages=["userscript:/", "page:loaded", "eval:42"],out_of_bounds_rejected=true,png=120x72 bytes=423.cargo check(blocked by the sandboxedblazewrapper; the example is macOS-only). Workspace fmt, clippy, and test not run for this PR.data/cgx-n196-832-hooks-proof/after-snapshot.png, not hosted.Checklist
rustfmt --edition 2024clean on the new file.cargo fmt --checkfor the workspace: not run.cargo clippy --workspace --all-targets -- -D warnings: not run.cargo test --workspace: not run.CHANGELOG.mdline: not applicable, no user-visible change.