diff --git a/examples/test-app/README.md b/examples/test-app/README.md index 46f606a3aa..a7652b8295 100644 --- a/examples/test-app/README.md +++ b/examples/test-app/README.md @@ -25,7 +25,10 @@ Navigation uses Expo Router native bottom tabs, so the tab bar itself is also pa The deterministic WebView fixture is the stable accessibility oracle. On iOS, an interactive snapshot should expose its root as `webview`, both titles as `heading`, paragraph and label content -as `text`, and the form controls as `text-field`, `switch`, and `button`. The live-site buttons are +as `text`, and the form controls as `text-field`, `switch`, and `button`. Its `Embedded frames` +section adds a same-origin `srcdoc` frame, an opaque-origin `data:` frame, and a cross-site frame +(`https://example.com/`, needs network); each frame's content appears inline in the snapshot on +iOS, Android, and web. The live-site buttons are exploratory smoke coverage for real-world WebKit trees, not stable assertion targets. Use an unscoped snapshot for this oracle: XCTest can detach a scoped WebKit document subtree from its `WebView` ancestor, leaving insufficient evidence for safe semantic projection. diff --git a/examples/test-app/src/screens/WebViewScreen.tsx b/examples/test-app/src/screens/WebViewScreen.tsx index 0d56a34921..c157f6aa51 100644 --- a/examples/test-app/src/screens/WebViewScreen.tsx +++ b/examples/test-app/src/screens/WebViewScreen.tsx @@ -116,6 +116,9 @@ export function WebViewScreen(props: { onClose: () => void }) { setLoadState((current) => (current.kind === 'error' ? current : { kind: 'loaded' })) } onLoadStart={() => setLoadState({ kind: 'loading' })} + // The default whitelist also gates iframe loads, which blocks the fixture's + // `about:srcdoc` and `data:` frames. + originWhitelist={['http://*', 'https://*', 'about:srcdoc', 'data:*']} source={site.source} startInLoadingState style={styles.webView} diff --git a/examples/test-app/src/webview-accessibility-fixture.ts b/examples/test-app/src/webview-accessibility-fixture.ts index 84f3820756..1a8a125693 100644 --- a/examples/test-app/src/webview-accessibility-fixture.ts +++ b/examples/test-app/src/webview-accessibility-fixture.ts @@ -66,6 +66,16 @@ export const WEBVIEW_ACCESSIBILITY_FIXTURE = ` alt="Blue accessibility test square" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Crect width='48' height='48' fill='%230078d4'/%3E%3C/svg%3E" /> +