summaryrefslogtreecommitdiffstats
path: root/dom/webgpu/tests/cts/checkout/src/common/framework
diff options
context:
space:
mode:
Diffstat (limited to 'dom/webgpu/tests/cts/checkout/src/common/framework')
-rw-r--r--dom/webgpu/tests/cts/checkout/src/common/framework/fixture.ts17
-rw-r--r--dom/webgpu/tests/cts/checkout/src/common/framework/test_config.ts18
2 files changed, 33 insertions, 2 deletions
diff --git a/dom/webgpu/tests/cts/checkout/src/common/framework/fixture.ts b/dom/webgpu/tests/cts/checkout/src/common/framework/fixture.ts
index 77875e047d..616023e20c 100644
--- a/dom/webgpu/tests/cts/checkout/src/common/framework/fixture.ts
+++ b/dom/webgpu/tests/cts/checkout/src/common/framework/fixture.ts
@@ -15,7 +15,8 @@ export type TestParams = {
type DestroyableObject =
| { destroy(): void }
| { close(): void }
- | { getExtension(extensionName: 'WEBGL_lose_context'): WEBGL_lose_context };
+ | { getExtension(extensionName: 'WEBGL_lose_context'): WEBGL_lose_context }
+ | HTMLVideoElement;
export class SubcaseBatchState {
constructor(
@@ -124,8 +125,12 @@ export class Fixture<S extends SubcaseBatchState = SubcaseBatchState> {
if (WEBGL_lose_context) WEBGL_lose_context.loseContext();
} else if ('destroy' in o) {
o.destroy();
- } else {
+ } else if ('close' in o) {
o.close();
+ } else {
+ // HTMLVideoElement
+ o.src = '';
+ o.srcObject = null;
}
}
}
@@ -161,6 +166,14 @@ export class Fixture<S extends SubcaseBatchState = SubcaseBatchState> {
this.rec.debug(new Error(msg));
}
+ /**
+ * Log an info message.
+ * **Use sparingly. Use `debug()` instead if logs are only needed with debug logging enabled.**
+ */
+ info(msg: string): void {
+ this.rec.info(new Error(msg));
+ }
+
/** Throws an exception marking the subcase as skipped. */
skip(msg: string): never {
throw new SkipTestCase(msg);
diff --git a/dom/webgpu/tests/cts/checkout/src/common/framework/test_config.ts b/dom/webgpu/tests/cts/checkout/src/common/framework/test_config.ts
index 2575418299..e6624ae120 100644
--- a/dom/webgpu/tests/cts/checkout/src/common/framework/test_config.ts
+++ b/dom/webgpu/tests/cts/checkout/src/common/framework/test_config.ts
@@ -1,4 +1,9 @@
export type TestConfig = {
+ /**
+ * Enable debug-level logs (normally logged via `Fixture.debug()`).
+ */
+ enableDebugLogs: boolean;
+
maxSubcasesInFlight: number;
testHeartbeatCallback: () => void;
noRaceWithRejectOnTimeout: boolean;
@@ -21,12 +26,25 @@ export type TestConfig = {
* Whether or not we're running in compatibility mode.
*/
compatibility: boolean;
+
+ /**
+ * Whether or not to request a fallback adapter.
+ */
+ forceFallbackAdapter: boolean;
+
+ /**
+ * Whether to enable the `logToWebSocket` function used for out-of-band test logging.
+ */
+ logToWebSocket: boolean;
};
export const globalTestConfig: TestConfig = {
+ enableDebugLogs: false,
maxSubcasesInFlight: 500,
testHeartbeatCallback: () => {},
noRaceWithRejectOnTimeout: false,
unrollConstEvalLoops: false,
compatibility: false,
+ forceFallbackAdapter: false,
+ logToWebSocket: false,
};