Guard browser OPFS direct session load options

This commit is contained in:
2026-06-14 06:18:41 +08:00
parent e0f7ebec4f
commit 9265825843
2 changed files with 64 additions and 11 deletions

View File

@@ -4647,6 +4647,15 @@
};
}
function opfsSessionLoadOptions(wasmPaths, extraOptions = {}) {
return {
...extraOptions,
iniWasmPath: wasmPaths.ini,
parameterWasmPath: wasmPaths.parameters,
toolTableWasmPath: wasmPaths.toolTable,
};
}
async function verifyOpfsSavedText(label, loadActualText, expectedLines) {
verifyExpectedOutput(label, await loadActualText(), expectedLines.join("\n"));
}
@@ -9322,11 +9331,7 @@
const loadedSession = await loadMachineSessionFromOpfs(
interp,
browserInterpMachineId,
{
iniWasmPath: browserInterpWasmPaths.ini,
parameterWasmPath: browserInterpWasmPaths.parameters,
toolTableWasmPath: browserInterpWasmPaths.toolTable,
},
opfsSessionLoadOptions(browserInterpWasmPaths),
);
assertOpfsSessionStaging(
"opfs_load_session_staging",
@@ -9486,12 +9491,7 @@
const loadedRandomSession = await loadMachineSessionFromOpfs(
interp,
browserRandomMachineId,
{
iniSdk: ini,
iniWasmPath: browserRandomWasmPaths.ini,
parameterWasmPath: browserRandomWasmPaths.parameters,
toolTableWasmPath: browserRandomWasmPaths.toolTable,
},
opfsSessionLoadOptions(browserRandomWasmPaths, { iniSdk: ini }),
);
assertOpfsSessionStaging(
"opfs_load_random_session_staging",