ReviewOS

also looking at this

craft-native/craft

fix(webview): recover from renderer crashes, and stop dropping window.open()

#72
Merged glennmichael123 wants to merge fix/webview-delegates into main
4 files +729 -23
packages/zig/build.zigmodified+25-0
Changes to packages/zig/build.zig
@@ -640,6 +640,27 @@ pub fn build(b: *std.Build) void {
640640 }),
641641 });
642642
643 // Where a link that asks for a new window is allowed to go. Pure policy,
644 // so the whole drop list is provable without a browser.
645 const external_link_tests = b.addTest(.{
646 .root_module = b.createModule(.{
647 .root_source_file = b.path("src/external_link.zig"),
648 .target = target,
649 .optimize = optimize,
650 }),
651 });
652
653 // The reload budget that brings a window back after WebKit's content
654 // process dies. Pure, and takes its clock as an argument, so a crash loop
655 // is testable without crashing anything.
656 const webview_recovery_tests = b.addTest(.{
657 .root_module = b.createModule(.{
658 .root_source_file = b.path("src/webview_recovery.zig"),
659 .target = target,
660 .optimize = optimize,
661 }),
662 });
663
643664 // The conformance test: what craft declares, against what it dispatches.
644665 const capability_conformance_tests = b.addTest(.{
645666 .root_module = b.createModule(.{
@@ -1010,6 +1031,8 @@ pub fn build(b: *std.Build) void {
10101031 const run_local_tls_tests = b.addRunArtifact(local_tls_tests);
10111032 const run_menu_roles_tests = b.addRunArtifact(menu_roles_tests);
10121033 const run_capabilities_tests = b.addRunArtifact(capabilities_tests);
1034 const run_external_link_tests = b.addRunArtifact(external_link_tests);
1035 const run_webview_recovery_tests = b.addRunArtifact(webview_recovery_tests);
10131036 const run_prefs_tests = b.addRunArtifact(prefs_tests);
10141037 const run_prefs_macos_tests = b.addRunArtifact(prefs_macos_tests);
10151038 const run_key_codes_tests = b.addRunArtifact(key_codes_tests);
@@ -1123,6 +1146,8 @@ pub fn build(b: *std.Build) void {
11231146 test_step.dependOn(&run_local_tls_tests.step);
11241147 test_step.dependOn(&run_menu_roles_tests.step);
11251148 test_step.dependOn(&run_capabilities_tests.step);
1149 test_step.dependOn(&run_external_link_tests.step);
1150 test_step.dependOn(&run_webview_recovery_tests.step);
11261151 // macOS only: the registry describes the dispatch chain in macos.zig, and
11271152 // compiling it elsewhere drags the whole native graph into a test binary
11281153 // for a platform it does not describe.