Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Dec 21, 2023
1 parent 6ecbf13 commit 36ac3e0
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/webgpu/idl/constructable.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,23 @@ export const description = `
Test that constructable WebGPU objects are actually constructable.
`;

import { keysOf } from '../../common/util/data_tables.js';

import { makeTestGroup } from './../../common/framework/test_group.js';
import { IDLTest } from './idl_test.js';

export const g = makeTestGroup(IDLTest);

const errors = {
GPUInternalError: globalThis.GPUInternalError,
GPUOutOfMemoryError: globalThis.GPUOutOfMemoryError,
GPUValidationError: globalThis.GPUValidationError,
};

g.test('gpu_errors')
.desc('tests that GPUErrors are constructable')
.params(u => u.combine('errorType', keysOf(errors)))
.params(u =>
u.combine('errorType', [
'GPUInternalError',
'GPUOutOfMemoryError',
'GPUValidationError',
] as const)
)
.fn(t => {
const { errorType } = t.params;
const Ctor = errors[errorType];
const Ctor = globalThis[errorType];
const msg = 'this is a test';
const error = new Ctor(msg);
t.expect(error.message === msg);
Expand Down

0 comments on commit 36ac3e0

Please sign in to comment.