参考所有分组,完成尽量多的内容。禁止顺手扩功能 smoke:锁定OPFS参数保存顺序
结论:按 LinuxCNC rs274ngc_pre.cc save_parameters() 的 .new、.bak、unlink/link/rename 顺序补强 OPFS/app/browser smoke 守卫,并验证临时参数文件不会残留在 OPFS。
This commit is contained in:
@@ -39,6 +39,13 @@ export async function runBrowserAppOpfsSections(context) {
|
||||
const updatedParameterFile = new TextDecoder().decode(await appSimulator.fs.opfs.readFile("parameters/rs274ngc.var"));
|
||||
expectIncludes(updatedParameterFile, "5161\t2.000000",
|
||||
"app frame did not replace LinuxCNC parameter state after second parse");
|
||||
// LinuxCNC source basis: rs274ngc_pre.cc save_parameters()
|
||||
// renames filename + ".new" over filename after a successful save.
|
||||
await context.expectOpfsMissing(
|
||||
appSimulator,
|
||||
"parameters/rs274ngc.var.new",
|
||||
"app frame did not clean up LinuxCNC temporary parameter file in OPFS",
|
||||
);
|
||||
const savedParameterBackup = new TextDecoder().decode(await appSimulator.fs.opfs.readFile("parameters/rs274ngc.var.bak"));
|
||||
expectIncludes(savedParameterBackup, "5161\t1.000000",
|
||||
"app frame did not persist LinuxCNC parameter backup into OPFS");
|
||||
|
||||
Reference in New Issue
Block a user