chore: checkpoint web Blender migration source, tools and docs
Accumulated uncommitted work: GHOST Web backend, WebGL/GPU web layer, web workflow engine and protocol, tooling, docs and task records. Large generated evidence, user-testing archives, build snapshots and imported test assets remain untracked. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
39
web/tests/e2e/b3-gzip-patch-audit.spec.ts
Normal file
39
web/tests/e2e/b3-gzip-patch-audit.spec.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { test } from "@playwright/test";
|
||||
|
||||
const root = path.resolve(import.meta.dirname, "../../..");
|
||||
|
||||
test("audit served worker and modern gzip error", async ({ page }) => {
|
||||
test.setTimeout(200_000);
|
||||
await page.addInitScript(() => {
|
||||
const scope = window as unknown as { __replies: unknown[] };
|
||||
scope.__replies = [];
|
||||
const descriptor = Object.getOwnPropertyDescriptor(Worker.prototype, "onmessage");
|
||||
if (!descriptor?.set) return;
|
||||
Object.defineProperty(Worker.prototype, "onmessage", {
|
||||
configurable: true,
|
||||
get: descriptor.get,
|
||||
set(value: ((event: MessageEvent) => unknown) | null) {
|
||||
if (typeof value !== "function") return descriptor.set!.call(this, value);
|
||||
return descriptor.set!.call(this, (event: MessageEvent) => {
|
||||
const data = event.data as { error?: { code?: string; message?: string } } | undefined;
|
||||
if (data?.error) scope.__replies.push({ code: data.error.code, message: String(data.error.message).slice(0, 300) });
|
||||
return value(event);
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
await page.goto("/");
|
||||
const served = await page.evaluate(async () => {
|
||||
const response = await fetch("/src/workers/web-engine.worker.ts");
|
||||
const text = await response.text();
|
||||
return { ok: response.ok, status: response.status, hasGzipPatch: text.includes("DecompressionStream"), hasBlenderMagic: /BLENDER/.test(text) };
|
||||
});
|
||||
await page.waitForTimeout(10000);
|
||||
await page.evaluate(() => ((window as unknown as { __replies: unknown[] }).__replies = []));
|
||||
await page.getByTestId("blend-file-input").setInputFiles(path.join(root, "blender-5.2.0/tests/files/io_tests/blend_geometry/all_quads.blend"));
|
||||
await page.waitForTimeout(28000);
|
||||
const replies = await page.evaluate(() => (window as unknown as { __replies: unknown[] }).__replies);
|
||||
fs.writeFileSync("/tmp/gzip-patch-audit.json", JSON.stringify({ served, replies }, null, 2));
|
||||
});
|
||||
Reference in New Issue
Block a user