From da9af4a660f2b032aa4eb5c245f884ccc47ab233 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Tue, 1 Sep 2026 17:29:18 -0400 Subject: [PATCH] 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 --- .../src/mobile-web/mobile-web-native-transport-source.test.ts | 3 ++- .../src/mobile-web/mobile-web-shell-root-route-source.test.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mobile/src/mobile-web/mobile-web-native-transport-source.test.ts b/mobile/src/mobile-web/mobile-web-native-transport-source.test.ts index af8d48d87cb..aa4cc29f89b 100644 --- a/mobile/src/mobile-web/mobile-web-native-transport-source.test.ts +++ b/mobile/src/mobile-web/mobile-web-native-transport-source.test.ts @@ -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)') diff --git a/mobile/src/mobile-web/mobile-web-shell-root-route-source.test.ts b/mobile/src/mobile-web/mobile-web-shell-root-route-source.test.ts index 348a986d6a4..4a80fe4224d 100644 --- a/mobile/src/mobile-web/mobile-web-shell-root-route-source.test.ts +++ b/mobile/src/mobile-web/mobile-web-shell-root-route-source.test.ts @@ -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"' )