Skip to content

Commit f6282ea

Browse files
📝 Add docstrings to codex/remove-disable-web-security-argument-from-playwright
Docstrings generation was requested by @shayancoin. * #166 (comment) The following files were modified: * `frontend/tests/e2e/utils/draco.ts`
1 parent 9683550 commit f6282ea

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

‎frontend/tests/e2e/utils/draco.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ const patchedContexts = new WeakSet<BrowserContext>();
2828
const fulfill = (route: Route, body: string | Buffer, contentType: string) =>
2929
route.fulfill({ status: 200, body, contentType, headers: { 'cache-control': 'public, max-age=86400' } });
3030

31+
/**
32+
* Register routes on a Playwright BrowserContext that serve local Draco decoder assets.
33+
*
34+
* Installs handlers that respond to the Draco CDN paths for `draco_wasm_wrapper.js`, `draco_decoder.js`,
35+
* and `draco_decoder.wasm` with the corresponding local package files. Calling this function multiple
36+
* times with the same context is a no-op.
37+
*
38+
* @param context - The Playwright BrowserContext to patch with Draco decoder routes
39+
*/
3140
export async function registerDracoRoutes(context: BrowserContext): Promise<void> {
3241
if (patchedContexts.has(context)) {
3342
return;
@@ -46,4 +55,4 @@ export async function registerDracoRoutes(context: BrowserContext): Promise<void
4655
fulfill(route, wasmBinary, 'application/wasm'),
4756
),
4857
]);
49-
}
58+
}

0 commit comments

Comments
 (0)