Advance Blender 5.2 web parity through M12-03D
This commit is contained in:
21
web/tests/unit/asset-preview-opfs-commit.test.mjs
Normal file
21
web/tests/unit/asset-preview-opfs-commit.test.mjs
Normal file
@@ -0,0 +1,21 @@
|
||||
import assert from "node:assert/strict";
|
||||
import crypto from "node:crypto";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import test from "node:test";
|
||||
|
||||
const root = path.resolve(import.meta.dirname, "../../..");
|
||||
const manifest = JSON.parse(fs.readFileSync(path.join(root, "tests/golden/M12-02D/manifest.json"), "utf8"));
|
||||
const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(path.join(root, file))).digest("hex");
|
||||
|
||||
test("M12-02D binds OPFS-before-catalog ordering and browser evidence", () => {
|
||||
assert.equal(manifest.task, "M12-02D");
|
||||
assert.equal(manifest.enablingTask, true);
|
||||
assert.equal(manifest.parityStateChange, false);
|
||||
assert.equal(manifest.nextTask, "M12-02E");
|
||||
assert.deepEqual(manifest.commitOrder, ["PRE_DECODE_GATE", "OPFS_WRITE", "OPFS_READBACK", "CATALOG_TRANSACTION"]);
|
||||
assert.deepEqual(manifest.faultPoints, ["BEFORE_OPFS_WRITE", "AFTER_OPFS_WRITE", "AFTER_CATALOG_PUT"]);
|
||||
for (const artifact of Object.values(manifest.artifacts)) {
|
||||
assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user