推进 INI 面板 shell handoff snapshot API
This commit is contained in:
@@ -73,7 +73,12 @@
|
||||
!launchApi?.getShellIntegrationSchema ||
|
||||
!launchApi?.getShellIntegrationManifest ||
|
||||
!launchApi?.getShellIntegrationReadiness ||
|
||||
!launchApi?.getShellSessionHandoffSummarySchema ||
|
||||
!launchApi?.getShellSessionHandoffSummary ||
|
||||
!launchApi?.isSupportedShellSessionHandoffSummary ||
|
||||
!launchApi?.getShellSessionHandoffCompatibilityReport ||
|
||||
!launchApi?.getShellSessionHandoffDisplayViewModel ||
|
||||
!launchApi?.getShellSessionHandoffSnapshot ||
|
||||
!launchApi?.getLauncherLinks ||
|
||||
!launchApi?.getControlPageApiMethods
|
||||
) {
|
||||
@@ -113,13 +118,17 @@
|
||||
);
|
||||
assertEqual(
|
||||
launchApiManifest.methods.join(","),
|
||||
"isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummary,getLauncherLinks,getControlPageApiMethods",
|
||||
"isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getLauncherLinks,getControlPageApiMethods",
|
||||
"launch API manifest methods",
|
||||
);
|
||||
const shellIntegrationSchema = launchApi.getShellIntegrationSchema();
|
||||
const shellIntegrationManifest = launchApi.getShellIntegrationManifest();
|
||||
const shellIntegrationReadiness = launchApi.getShellIntegrationReadiness();
|
||||
const shellSessionHandoffSummarySchema = launchApi.getShellSessionHandoffSummarySchema();
|
||||
const shellSessionHandoffSummary = launchApi.getShellSessionHandoffSummary();
|
||||
const shellSessionHandoffCompatibilityReport = launchApi.getShellSessionHandoffCompatibilityReport();
|
||||
const shellSessionHandoffDisplayViewModel = launchApi.getShellSessionHandoffDisplayViewModel();
|
||||
const shellSessionHandoffSnapshot = launchApi.getShellSessionHandoffSnapshot();
|
||||
assertEqual(
|
||||
shellIntegrationSchema.manifestVersion,
|
||||
1,
|
||||
@@ -165,6 +174,86 @@
|
||||
true,
|
||||
"shell session handoff summary readiness",
|
||||
);
|
||||
assertEqual(
|
||||
shellSessionHandoffSummarySchema.summaryVersion,
|
||||
1,
|
||||
"shell session handoff summary schema version",
|
||||
);
|
||||
assertEqual(
|
||||
launchApi.isSupportedShellSessionHandoffSummary(shellSessionHandoffSummary),
|
||||
true,
|
||||
"shell session handoff summary supported",
|
||||
);
|
||||
assertEqual(
|
||||
launchApi.isSupportedShellSessionHandoffSummary({ ...shellSessionHandoffSummary, summaryVersion: 2 }),
|
||||
false,
|
||||
"shell session handoff summary rejects version",
|
||||
);
|
||||
assertEqual(
|
||||
shellSessionHandoffCompatibilityReport.compatible,
|
||||
true,
|
||||
"shell session handoff compatibility report",
|
||||
);
|
||||
assertEqual(
|
||||
shellSessionHandoffCompatibilityReport.summarySupported,
|
||||
true,
|
||||
"shell session handoff summary support report",
|
||||
);
|
||||
assertEqual(
|
||||
shellSessionHandoffCompatibilityReport.missingFields.join(","),
|
||||
"",
|
||||
"shell session handoff compatibility missing fields",
|
||||
);
|
||||
assertEqual(
|
||||
shellSessionHandoffDisplayViewModel.statusText,
|
||||
"Ready",
|
||||
"shell session handoff display status",
|
||||
);
|
||||
assertEqual(
|
||||
shellSessionHandoffDisplayViewModel.rows.length,
|
||||
5,
|
||||
"shell session handoff display rows",
|
||||
);
|
||||
assertEqual(
|
||||
shellSessionHandoffSnapshot.snapshotVersion,
|
||||
1,
|
||||
"shell session handoff snapshot version",
|
||||
);
|
||||
assertEqual(
|
||||
shellSessionHandoffSnapshot.ready,
|
||||
true,
|
||||
"shell session handoff snapshot readiness",
|
||||
);
|
||||
assertEqual(
|
||||
JSON.stringify(shellSessionHandoffSnapshot.readiness),
|
||||
JSON.stringify(shellIntegrationReadiness),
|
||||
"shell session handoff snapshot readiness object",
|
||||
);
|
||||
assertEqual(
|
||||
JSON.stringify(shellSessionHandoffSnapshot.summary),
|
||||
JSON.stringify(shellSessionHandoffSummary),
|
||||
"shell session handoff snapshot summary object",
|
||||
);
|
||||
assertEqual(
|
||||
JSON.stringify(shellSessionHandoffSnapshot.displayViewModel),
|
||||
JSON.stringify(shellSessionHandoffDisplayViewModel),
|
||||
"shell session handoff snapshot display object",
|
||||
);
|
||||
assertEqual(
|
||||
launchDoc.querySelector("[data-handoff-status]").textContent,
|
||||
"Ready: No blocking reasons",
|
||||
"shell session handoff DOM status",
|
||||
);
|
||||
assertEqual(
|
||||
launchDoc.querySelector('[data-handoff-value="missing-fields"]').textContent,
|
||||
"none",
|
||||
"shell session handoff DOM missing fields",
|
||||
);
|
||||
assertEqual(
|
||||
launchDoc.querySelector('[data-handoff-value="blocking-reasons"]').textContent,
|
||||
"none",
|
||||
"shell session handoff DOM blocking reasons",
|
||||
);
|
||||
assertEqual(
|
||||
shellSessionHandoffSummary.targetPage.href,
|
||||
"./control-page.html",
|
||||
|
||||
Reference in New Issue
Block a user