Debian Codegraph @

testing/web-platform/mozilla/tests/webgpu/common/internal/logging/logger.js

raw
1 /**
2 * AUTO-GENERATED - DO NOT EDIT. Source: https://github.com/gpuweb/cts
3 **/import { globalTestConfig } from '../../framework/test_config.js';import { version } from '../version.js';
4
5 import { TestCaseRecorder } from './test_case_recorder.js';
6
7
8
9 export class Logger {
10
11 results = new Map();
12
13 constructor({ overrideDebugMode } = {}) {
14 this.overriddenDebugMode = overrideDebugMode;
15 }
16
17 record(name) {
18 const result = { status: 'running', timems: -1 };
19 this.results.set(name, result);
20 return [
21 new TestCaseRecorder(result, this.overriddenDebugMode ?? globalTestConfig.enableDebugLogs),
22 result];
23
24 }
25
26 asJSON(space) {
27 return JSON.stringify({ version, results: Array.from(this.results) }, undefined, space);
28 }
29 }