推进 INI 面板 shell handoff render-state

This commit is contained in:
2026-06-15 09:51:18 +08:00
parent 5c951ab9bc
commit b1f23e6641
10 changed files with 300 additions and 11 deletions

View File

@@ -79,6 +79,7 @@
!launchApi?.getShellSessionHandoffCompatibilityReport ||
!launchApi?.getShellSessionHandoffDisplayViewModel ||
!launchApi?.getShellSessionHandoffSnapshot ||
!launchApi?.getShellSessionHandoffRenderState ||
!launchApi?.getLauncherLinks ||
!launchApi?.getControlPageApiMethods
) {
@@ -118,7 +119,7 @@
);
assertEqual(
launchApiManifest.methods.join(","),
"isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getLauncherLinks,getControlPageApiMethods",
"isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getShellSessionHandoffRenderState,getLauncherLinks,getControlPageApiMethods",
"launch API manifest methods",
);
const shellIntegrationSchema = launchApi.getShellIntegrationSchema();
@@ -129,6 +130,7 @@
const shellSessionHandoffCompatibilityReport = launchApi.getShellSessionHandoffCompatibilityReport();
const shellSessionHandoffDisplayViewModel = launchApi.getShellSessionHandoffDisplayViewModel();
const shellSessionHandoffSnapshot = launchApi.getShellSessionHandoffSnapshot();
const shellSessionHandoffRenderState = launchApi.getShellSessionHandoffRenderState();
assertEqual(
shellIntegrationSchema.manifestVersion,
1,
@@ -224,6 +226,21 @@
true,
"shell session handoff snapshot readiness",
);
assertEqual(
shellSessionHandoffRenderState.renderStateVersion,
1,
"shell session handoff render-state version",
);
assertEqual(
shellSessionHandoffRenderState.ready,
true,
"shell session handoff render-state readiness",
);
assertEqual(
shellSessionHandoffRenderState.statusLine,
"Ready: No blocking reasons",
"shell session handoff render-state status",
);
assertEqual(
JSON.stringify(shellSessionHandoffSnapshot.readiness),
JSON.stringify(shellIntegrationReadiness),
@@ -239,11 +256,26 @@
JSON.stringify(shellSessionHandoffDisplayViewModel),
"shell session handoff snapshot display object",
);
assertEqual(
JSON.stringify(shellSessionHandoffRenderState.rows),
JSON.stringify(shellSessionHandoffDisplayViewModel.rows),
"shell session handoff render-state rows",
);
assertEqual(
launchDoc.querySelector("[data-handoff-status]").textContent,
"Ready: No blocking reasons",
"shell session handoff DOM status",
);
assertEqual(
launchDoc.querySelector("[data-handoff-shell]").dataset.handoffPhase,
"ready",
"shell session handoff DOM phase",
);
assertEqual(
launchDoc.querySelector("[data-handoff-shell]").dataset.handoffReady,
"true",
"shell session handoff DOM ready",
);
assertEqual(
launchDoc.querySelector('[data-handoff-value="missing-fields"]').textContent,
"none",

View File

@@ -69,7 +69,8 @@ TOOL_TABLE = browser-shell-tool.tbl
!launchApi?.isSupportedShellSessionHandoffSummary ||
!launchApi?.getShellSessionHandoffCompatibilityReport ||
!launchApi?.getShellSessionHandoffDisplayViewModel ||
!launchApi?.getShellSessionHandoffSnapshot
!launchApi?.getShellSessionHandoffSnapshot ||
!launchApi?.getShellSessionHandoffRenderState
) {
throw new Error("launch API namespace did not expose shell integration helpers");
}
@@ -81,6 +82,7 @@ TOOL_TABLE = browser-shell-tool.tbl
const compatibilityReport = launchApi.getShellSessionHandoffCompatibilityReport();
const handoffDisplay = launchApi.getShellSessionHandoffDisplayViewModel();
const handoffSnapshot = launchApi.getShellSessionHandoffSnapshot();
const handoffRenderState = launchApi.getShellSessionHandoffRenderState();
assertEqual(handoffSummarySchema.summaryVersion, 1, "shell handoff summary schema version");
assertEqual(
launchApi.isSupportedShellSessionHandoffSummary(handoffSummary),
@@ -94,6 +96,9 @@ TOOL_TABLE = browser-shell-tool.tbl
assertEqual(handoffDisplay.detailText, "No blocking reasons", "shell handoff display detail");
assertEqual(handoffSnapshot.ready, true, "shell handoff snapshot readiness");
assertEqual(handoffSnapshot.displayViewModel.statusText, "Ready", "shell handoff snapshot display status");
assertEqual(handoffRenderState.ready, true, "shell handoff render-state readiness");
assertEqual(handoffRenderState.statusLine, "Ready: No blocking reasons", "shell handoff render-state status");
assertEqual(handoffRenderState.rows.length, handoffDisplay.rows.length, "shell handoff render-state rows");
assertEqual(readiness.phase, "ready", "shell integration readiness phase");
assertEqual(readiness.ready, true, "shell integration readiness");
assertEqual(readiness.missing.join(","), "", "shell integration readiness missing checks");