推进 INI 面板 launch 暴露 control-page API 清单
This commit is contained in:
@@ -8,7 +8,9 @@
|
||||
<pre id="status">running</pre>
|
||||
<script type="module">
|
||||
import {
|
||||
createControlPageBrowserApiMethods,
|
||||
createIniPanelLauncherLinkViewModel,
|
||||
createIniPanelShellViewModel,
|
||||
getIniPanelEntryByHref,
|
||||
getVisibleIniPanelEntries,
|
||||
} from "../../runtime/ui/ini-panel/ui-shell.js";
|
||||
@@ -44,8 +46,17 @@
|
||||
"Open read-only control view",
|
||||
"launch manifest control entry",
|
||||
);
|
||||
assertEqual(
|
||||
createIniPanelShellViewModel().controlPage.browserApiMethods.join(","),
|
||||
createControlPageBrowserApiMethods().join(","),
|
||||
"launch shell control-page browser API methods",
|
||||
);
|
||||
|
||||
const launchDoc = await loadLaunchFrame();
|
||||
const launchApi = launchDoc.defaultView.linuxCncIniPanelLaunchApi;
|
||||
if (!launchApi?.getLauncherLinks || !launchApi?.getControlPageApiMethods) {
|
||||
throw new Error("launch API namespace did not expose shell helpers");
|
||||
}
|
||||
assertEqual(
|
||||
launchDoc.querySelector('a[href="./index.html"]').textContent,
|
||||
"Open edit and run panel",
|
||||
@@ -56,6 +67,16 @@
|
||||
"Open read-only control view",
|
||||
"launch panel control link",
|
||||
);
|
||||
assertEqual(
|
||||
launchApi.getLauncherLinks().length,
|
||||
2,
|
||||
"launch API launcher link count",
|
||||
);
|
||||
assertEqual(
|
||||
launchApi.getControlPageApiMethods().join(","),
|
||||
createControlPageBrowserApiMethods().join(","),
|
||||
"launch API control-page browser methods",
|
||||
);
|
||||
status.textContent = "browser_ini_launch_smoke=ok";
|
||||
console.log("browser_ini_launch_smoke=ok");
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user