test(mobile-web): pin the Android bridge URL guard after the compile fix

The Kotlin compile fix replaced the android.net.Uri origin check in
MobileWebBridgeDocumentUrl with a JVM-testable host projection and
hoisted activeSessionId into a local; the source-parity assertions still
named the old spellings.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
This commit is contained in:
Jinwoo-H
2026-09-01 17:29:18 -04:00
parent e812bb66c4
commit da9af4a660
2 changed files with 4 additions and 2 deletions
@@ -70,7 +70,8 @@ describe('mobile web native bridge transport', () => {
expect(androidSource).toContain(
'!isAllowedMobileWebBridgeDocumentUrl(documentUrl.toString(), sessionId)'
)
expect(androidBridgeUrlSource).toContain('isMobileWebOriginForSession(url, sessionId)')
expect(androidBridgeUrlSource).toContain('url.scheme == MOBILE_WEB_ORIGIN_SCHEME')
expect(androidBridgeUrlSource).toContain('url.host == mobileWebOriginHostForSession(sessionId)')
expect(androidBridgeUrlSource).toContain('url.fragment == sessionId')
expect(androidBridgeUrlSource).toContain('url.userInfo == null')
expect(androidSource).toContain('request.isForMainFrame && isAllowedDocumentUrl(url)')
@@ -50,7 +50,8 @@ describe('mobile web shell root route', () => {
expect(androidShellViewSource).toContain('url.path == "/"')
expect(androidShellViewSource).toContain('url.encodedPath == "/"')
expect(androidShellViewSource).toContain('url.query == null')
expect(androidShellViewSource).toContain('url.fragment == activeSessionId')
expect(androidShellViewSource).toContain('val sessionId = activeSessionId ?: return false')
expect(androidShellViewSource).toContain('url.fragment == sessionId &&')
expect(androidPackageStoreSource).toContain(
'"url" to "${mobileWebOriginForSession(sessionId)}/#$sessionId"'
)