Guard browser OPFS INI staging
This commit is contained in:
@@ -4469,6 +4469,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
function assertOpfsIniStaging(label, iniFile, expectedOpfsPath, expectedWasmPath) {
|
||||
if (iniFile.opfsPath !== expectedOpfsPath) {
|
||||
throw new Error(`${label}: unexpected INI OPFS path ${iniFile.opfsPath}`);
|
||||
}
|
||||
if (iniFile.wasmPath !== expectedWasmPath) {
|
||||
throw new Error(`${label}: unexpected INI WASM path ${iniFile.wasmPath}`);
|
||||
}
|
||||
}
|
||||
|
||||
function generatedToolTablePath(wasmPath, expectedWasmPath) {
|
||||
if (wasmPath !== expectedWasmPath) {
|
||||
throw new Error(`browser_tool_table_fixture_${expectedWasmPath}: path drift`);
|
||||
@@ -8994,6 +9003,12 @@
|
||||
toolTableWasmPath: "/work/browser-tool.tbl",
|
||||
},
|
||||
);
|
||||
assertOpfsIniStaging(
|
||||
"opfs_load_ini_staging",
|
||||
loadedSession.ini,
|
||||
"linuxcnc/machines/browser-interp/machine.ini",
|
||||
"/work/browser-machine.ini",
|
||||
);
|
||||
assertOpfsToolTableStaging(
|
||||
"opfs_load_tool_table_staging",
|
||||
loadedSession.toolTable,
|
||||
@@ -9155,6 +9170,12 @@
|
||||
toolTableWasmPath: "/work/browser-random-tool.tbl",
|
||||
},
|
||||
);
|
||||
assertOpfsIniStaging(
|
||||
"opfs_load_random_ini_staging",
|
||||
loadedRandomSession.ini,
|
||||
"linuxcnc/machines/browser-random-toolchanger/machine.ini",
|
||||
"/work/browser-random-machine.ini",
|
||||
);
|
||||
assertOpfsToolTableStaging(
|
||||
"opfs_load_random_tool_table_staging",
|
||||
loadedRandomSession.toolTable,
|
||||
@@ -9260,6 +9281,12 @@
|
||||
toolTableWasmPath: "/work/browser-custom-tool.tbl",
|
||||
},
|
||||
);
|
||||
assertOpfsIniStaging(
|
||||
"opfs_load_ini_named_ini_staging",
|
||||
loadedIniFileSession.ini,
|
||||
"linuxcnc/machines/browser-ini-file-session/machine.ini",
|
||||
"/work/browser-ini-file-session.ini",
|
||||
);
|
||||
assertOpfsToolTableStaging(
|
||||
"opfs_load_ini_named_tool_table_staging",
|
||||
loadedIniFileSession.toolTable,
|
||||
@@ -9423,6 +9450,12 @@
|
||||
toolTableWasmPath: "/work/browser-explicit-tool.tbl",
|
||||
},
|
||||
);
|
||||
assertOpfsIniStaging(
|
||||
"opfs_load_explicit_ini_staging",
|
||||
loadedIniOverrideSession.ini,
|
||||
"linuxcnc/machines/browser-ini-override-session/machine.ini",
|
||||
"/work/browser-ini-override-session.ini",
|
||||
);
|
||||
assertOpfsToolTableStaging(
|
||||
"opfs_load_explicit_tool_table_staging",
|
||||
loadedIniOverrideSession.toolTable,
|
||||
|
||||
Reference in New Issue
Block a user