also looking at this
fix(android): an apostrophe in a reply hangs the page forever
#156
4 files
+279
-73
| @@ -505,6 +505,49 @@ pub fn build(b: *std.Build) void { | ||
| 505 | 505 | }); |
| 506 | 506 | const run_android_bridge_tests = b.addRunArtifact(android_bridge_tests); |
| 507 | 507 | |
| 508 | // The reply channel's escaping, across every Kotlin template. | |
| 509 | // | |
| 510 | // Every template is imported, not just the four that talk to the WebView | |
| 511 | // today, so a file starting to emit JavaScript is already covered. | |
| 512 | // | |
| 513 | // The list is hand-written. Generating it by reading the directory here was | |
| 514 | // tried and removed: `zig build` caches this script's evaluation against its | |
| 515 | // own contents, so the generated list did not change when a template was | |
| 516 | // added — the completeness check passed by reading a stale list, which is | |
| 517 | // the exact failure it existed to prevent. | |
| 518 | const android_escaping_tests = b.addTest(.{ | |
| 519 | .root_module = b.createModule(.{ | |
| 520 | .root_source_file = b.path("test/android_reply_escaping_test.zig"), | |
| 521 | .target = target, | |
| 522 | .optimize = optimize, | |
| 523 | }), | |
| 524 | }); | |
| 525 | android_escaping_tests.root_module.addAnonymousImport("CraftBridge.kt.template", .{ | |
| 526 | .root_source_file = b.path("../android/templates/CraftBridge.kt.template"), | |
| 527 | }); | |
| 528 | android_escaping_tests.root_module.addAnonymousImport("CraftBridgeExtensions.kt.template", .{ | |
| 529 | .root_source_file = b.path("../android/templates/CraftBridgeExtensions.kt.template"), | |
| 530 | }); | |
| 531 | android_escaping_tests.root_module.addAnonymousImport("CraftHealthConnect.kt.template", .{ | |
| 532 | .root_source_file = b.path("../android/templates/CraftHealthConnect.kt.template"), | |
| 533 | }); | |
| 534 | android_escaping_tests.root_module.addAnonymousImport("CraftHealthConnectStub.kt.template", .{ | |
| 535 | .root_source_file = b.path("../android/templates/CraftHealthConnectStub.kt.template"), | |
| 536 | }); | |
| 537 | android_escaping_tests.root_module.addAnonymousImport("CraftNative.kt.template", .{ | |
| 538 | .root_source_file = b.path("../android/templates/CraftNative.kt.template"), | |
| 539 | }); | |
| 540 | android_escaping_tests.root_module.addAnonymousImport("CraftWidgetProvider.kt.template", .{ | |
| 541 | .root_source_file = b.path("../android/templates/CraftWidgetProvider.kt.template"), | |
| 542 | }); | |
| 543 | android_escaping_tests.root_module.addAnonymousImport("LocationRecordingService.kt.template", .{ | |
| 544 | .root_source_file = b.path("../android/templates/LocationRecordingService.kt.template"), | |
| 545 | }); | |
| 546 | android_escaping_tests.root_module.addAnonymousImport("MainActivity.kt.template", .{ | |
| 547 | .root_source_file = b.path("../android/templates/MainActivity.kt.template"), | |
| 548 | }); | |
| 549 | const run_android_escaping_tests = b.addRunArtifact(android_escaping_tests); | |
| 550 | ||
| 508 | 551 | ios_conformance_tests.root_module.addAnonymousImport("CraftApp.swift", .{ |
| 509 | 552 | .root_source_file = b.path("../ios/templates/CraftApp.swift"), |
| 510 | 553 | }); |
| @@ -1648,6 +1691,7 @@ pub fn build(b: *std.Build) void { | ||
| 1648 | 1691 | test_step.dependOn(&run_bridge_surface_tests.step); |
| 1649 | 1692 | test_step.dependOn(&run_android_conformance_tests.step); |
| 1650 | 1693 | test_step.dependOn(&run_android_bridge_tests.step); |
| 1694 | test_step.dependOn(&run_android_escaping_tests.step); | |
| 1651 | 1695 | test_step.dependOn(&run_menubar_tests.step); |
| 1652 | 1696 | test_step.dependOn(&run_components_tests.step); |
| 1653 | 1697 | test_step.dependOn(&run_gpu_tests.step); |
| @@ -2377,6 +2421,7 @@ pub fn build(b: *std.Build) void { | ||
| 2377 | 2421 | test_android_step.dependOn(&run_bridge_surface_tests.step); |
| 2378 | 2422 | test_android_step.dependOn(&run_android_conformance_tests.step); |
| 2379 | 2423 | test_android_step.dependOn(&run_android_bridge_tests.step); |
| 2424 | test_android_step.dependOn(&run_android_escaping_tests.step); | |
| 2380 | 2425 | |
| 2381 | 2426 | // Add Android tests to the main test step |
| 2382 | 2427 | test_step.dependOn(&run_android_tests.step); |