Checkpoint web parity through Chromium input tasks
This commit is contained in:
27
web/app/src/testing/script-sandbox-dispose.ts
Normal file
27
web/app/src/testing/script-sandbox-dispose.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
export const SCRIPT_SANDBOX_DISPOSE_SCHEMA = 1 as const;
|
||||
|
||||
export interface ScriptSandboxDisposeReceipt {
|
||||
schemaVersion: typeof SCRIPT_SANDBOX_DISPOSE_SCHEMA;
|
||||
disposeCount: number;
|
||||
idempotent: boolean;
|
||||
resources: {
|
||||
messagePorts: 0;
|
||||
timers: 0;
|
||||
abortControllers: 0;
|
||||
transferableBuffers: 0;
|
||||
pendingRequests: 0;
|
||||
cacheReferences: 0;
|
||||
};
|
||||
lateTimerMessages: 0;
|
||||
}
|
||||
|
||||
export function createScriptSandboxDisposeReceipt(disposeCount: number): ScriptSandboxDisposeReceipt {
|
||||
if (!Number.isSafeInteger(disposeCount) || disposeCount < 1) throw new Error("SCRIPT_SANDBOX_DISPOSE_INVALID: dispose count must be positive");
|
||||
return {
|
||||
schemaVersion: SCRIPT_SANDBOX_DISPOSE_SCHEMA,
|
||||
disposeCount,
|
||||
idempotent: disposeCount > 1,
|
||||
resources: { messagePorts: 0, timers: 0, abortControllers: 0, transferableBuffers: 0, pendingRequests: 0, cacheReferences: 0 },
|
||||
lateTimerMessages: 0,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user