补齐移动壳进程崩溃恢复边界

移动壳 WebView 进程失败增加防循环恢复

加载失败面板承接连续进程恢复失败

配置检查和文档同步崩溃恢复约束
This commit is contained in:
2026-06-20 19:07:12 +08:00
parent fc9a557978
commit c5d899480f
7 changed files with 206 additions and 11 deletions
+15 -2
View File
@@ -1396,8 +1396,12 @@ for (const snippet of [
'webViewRef.current?.reload()',
'const reloadCurrentWebView = useCallback(() => {',
'reloadWebView: reloadCurrentWebView',
'onContentProcessDidTerminate={reloadCurrentWebView}',
'onRenderProcessGone={reloadCurrentWebView}',
'MOBILE_WEBVIEW_PROCESS_FAILURE_WINDOW_MS',
'MOBILE_WEBVIEW_PROCESS_FAILURE_RELOAD_LIMIT',
'handleWebViewProcessFailure',
"console.warn('mobile WebView process failed'",
"handleWebViewProcessFailure('content_process_terminated')",
"handleWebViewProcessFailure('render_process_gone')",
'normalizeMobileShellLoadFailure',
'handleWebViewLoadError',
'handleWebViewHttpError',
@@ -1558,6 +1562,8 @@ for (const snippet of [
'sameDocumentUrl',
'shouldOpenInMobileShellWebView',
"input.type === 'http'",
"input.type === 'process'",
"title: '页面已停止'",
"title: '网络不可用'",
"retryLabel: '重试'",
"url.pathname !== '/favicon.ico'",
@@ -1572,6 +1578,9 @@ for (const snippet of [
"test('归一化同源 HTTP 加载失败'",
"test('忽略外域和非页面加载失败'",
"test('只展示当前主页面失败'",
"test('连续 WebView 进程恢复失败时展示同源页面兜底'",
"type: 'process'",
"title: '页面已停止'",
"url: 'https://example.com/'",
"url: 'about:blank'",
"url: 'javascript:alert(1)'",
@@ -2509,6 +2518,10 @@ for (const snippet of [
"'mobile shell deep link failed for initial_url.read'",
'runtime deep link rejections are logged and fall back to a safe WebView URL',
"'mobile shell deep link failed for runtime_url.rejected'",
'first WebView process failure reloads the current page once',
'mobile WebView process failed',
'repeated WebView process failures show the load failure panel and retry clears the failure window',
"expect(screen.getByText('页面已停止')).toBeTruthy()",
'expect.any(Error)',
]) {
if (!shellAppTestSource.includes(snippet)) {