Skip to content

test: assert onUrlChanged domain-change contract end to end#296

Open
theoden8 wants to merge 3 commits into
masterfrom
claude/test-domain-change-navigation-kCzkt
Open

test: assert onUrlChanged domain-change contract end to end#296
theoden8 wants to merge 3 commits into
masterfrom
claude/test-domain-change-navigation-kCzkt

Conversation

@theoden8

@theoden8 theoden8 commented May 4, 2026

Copy link
Copy Markdown
Owner

Cover the two-pronged promise of the production onUrlChanged wiring (lib/web_view_model.dart): a cross-domain URL hands the destination to a nested browser and steers the parent back to the prior in-domain page; a same-domain URL is committed in place. Drives the production NavigationDecisionEngine through the existing NavigationTestHarness so the two halves can't drift apart, and adds fallback-to-initUrl, subdomain, and gmail/google-alias cases.

@theoden8 theoden8 force-pushed the claude/test-domain-change-navigation-kCzkt branch 2 times, most recently from e6f59ce to bf7c104 Compare May 8, 2026 09:37
claude added 3 commits May 10, 2026 14:12
Cover the two-pronged promise of the production onUrlChanged wiring
(lib/web_view_model.dart): a cross-domain URL hands the destination
to a nested browser and steers the parent back to the prior
in-domain page; a same-domain URL is committed in place. Drives the
production NavigationDecisionEngine through the existing
NavigationTestHarness so the two halves can't drift apart, and adds
fallback-to-initUrl, subdomain, and gmail/google-alias cases.
…pted

Drives the production navigation pipeline against a real WebView and
a local HttpServer-backed SPA page. Asserts via LogService that a
script-initiated `window.location.href = '<cross-domain>'` (no user
gesture, default blockAutoRedirects=true posture) fires
shouldOverrideUrlLoading, the engine logs the auto-redirect-blocked
CANCEL, and the cross-domain URL is never committed as the parent
webview's currentUrl. Complements the engine harness in
test/nested_webview_navigation_test.dart by exercising the full
WebView ↔ Dart callback wiring at lib/web_view_model.dart:619-655.
Cannot run locally without the WPE WebKit chroot harness; relies on
the Linux integration test pipeline (sid container) in CI.
`_hasUserGesture` previously fell through to `return true` on every
non-Android, non-Apple platform, so on Linux every navigation read
as a user click. JS-driven cross-domain redirects in SPAs took the
`blockOpenNested` branch instead of `blockSilent` and popped a
nested browser per auto-redirect — silent-block protection was
effectively off. Surfaced by
integration_test/spa_cross_domain_navigation_test.dart.

The Linux fork already serializes `navigationType`, so use the same
LINK_ACTIVATED / FORM_SUBMITTED heuristic as iOS/macOS. WPE WebKit's
`WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED` currently collapses into
`other` in the fork's `NavigationActionType` enum, so user-driven
cross-origin form posts on Linux read as no-gesture and silently
block; documented in the navigation spec's quirks table.
@theoden8 theoden8 force-pushed the claude/test-domain-change-navigation-kCzkt branch from bf7c104 to d2500d0 Compare May 10, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants