Guard browser OPFS custom session wasm input paths

This commit is contained in:
2026-06-13 23:49:02 +08:00
parent 327f86804c
commit 33ae88bc21
2 changed files with 70 additions and 10 deletions

View File

@@ -4545,6 +4545,10 @@
return opfsPath;
}
function opfsCustomSessionWasmPath(filename) {
return `/work/${filename}`;
}
function opfsCustomSessionPaths(machineId, parameterFilename, toolTableFilename, iniWasmPath) {
return {
opfs: {
@@ -4553,8 +4557,8 @@
},
wasm: {
ini: iniWasmPath,
parameters: `/work/${parameterFilename}`,
toolTable: `/work/${toolTableFilename}`,
parameters: opfsCustomSessionWasmPath(parameterFilename),
toolTable: opfsCustomSessionWasmPath(toolTableFilename),
},
};
}
@@ -9432,8 +9436,8 @@
{
iniSdk: ini,
iniWasmPath: "/work/browser-ini-file-session.ini",
parameterWasmPath: "/work/browser-custom.var",
toolTableWasmPath: "/work/browser-custom-tool.tbl",
parameterWasmPath: opfsCustomSessionWasmPath("browser-custom.var"),
toolTableWasmPath: opfsCustomSessionWasmPath("browser-custom-tool.tbl"),
},
);
assertOpfsSessionStaging(
@@ -9478,7 +9482,7 @@
savedIniNamedParameters,
"browser-ini-file-session",
"browser-custom.var",
"/work/browser-custom.var",
opfsCustomSessionWasmPath("browser-custom.var"),
);
verifyExpectedOutput(
"opfs_save_ini_named_parameter_file",
@@ -9536,7 +9540,7 @@
savedIniNamedToolTable,
"browser-ini-file-session",
"browser-custom-tool.tbl",
"/work/browser-custom-tool.tbl",
opfsCustomSessionWasmPath("browser-custom-tool.tbl"),
);
verifyExpectedOutput(
"opfs_save_ini_named_tool_table",
@@ -9601,9 +9605,9 @@
iniSdk: ini,
iniWasmPath: "/work/browser-ini-override-session.ini",
parameterFilename: "browser-explicit.var",
parameterWasmPath: "/work/browser-explicit.var",
parameterWasmPath: opfsCustomSessionWasmPath("browser-explicit.var"),
toolTableFilename: "browser-explicit-tool.tbl",
toolTableWasmPath: "/work/browser-explicit-tool.tbl",
toolTableWasmPath: opfsCustomSessionWasmPath("browser-explicit-tool.tbl"),
},
);
assertOpfsSessionStaging(
@@ -9660,7 +9664,7 @@
savedExplicitParameters,
"browser-ini-override-session",
"browser-explicit.var",
"/work/browser-explicit.var",
opfsCustomSessionWasmPath("browser-explicit.var"),
);
verifyExpectedOutput(
"opfs_save_explicit_parameter_file",
@@ -9706,7 +9710,7 @@
savedExplicitToolTable,
"browser-ini-override-session",
"browser-explicit-tool.tbl",
"/work/browser-explicit-tool.tbl",
opfsCustomSessionWasmPath("browser-explicit-tool.tbl"),
);
verifyExpectedOutput(
"opfs_save_explicit_tool_table",