test: assert onUrlChanged domain-change contract end to end#296
Open
theoden8 wants to merge 3 commits into
Open
test: assert onUrlChanged domain-change contract end to end#296theoden8 wants to merge 3 commits into
theoden8 wants to merge 3 commits into
Conversation
e6f59ce to
bf7c104
Compare
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.
bf7c104 to
d2500d0
Compare
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.
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.