also looking at this
fix(android): make a dropped script visible, instead of reporting it delivered
#238
6 files
+131
-16
| @@ -981,7 +981,11 @@ describe('Craft Android builder', () => { | ||
| 981 | 981 | expect(bridge.match(/webView\.evaluateJavascript\(/g)?.length).toBe(4) |
| 982 | 982 | expect(bridge).toContain('private fun evaluateJavascriptUnlessClosed(script: String)') |
| 983 | 983 | expect(bridge).toContain('evaluatePromiseJavascript(script: String) {\n evaluateJavascriptUnlessClosed(script)') |
| 984 | expect(nativeDelivery).toContain('runCatching { deliverer?.invoke(script) }') | |
| 984 | // Still no throw back into Zig, and since #231 it answers whether a | |
| 985 | // deliverer took the script rather than swallowing the drop. | |
| 986 | expect(nativeDelivery).toContain('fun deliver(script: String): Boolean') | |
| 987 | expect(nativeDelivery).toContain('val target = deliverer ?: return false') | |
| 988 | expect(nativeDelivery).toContain('runCatching { target(script); true }.getOrDefault(false)') | |
| 985 | 989 | for (const cleanup of [ |
| 986 | 990 | 'window.__craftRejectPendingPromises', |
| 987 | 991 | 'CraftNative.close(activity)', |