diff options
Diffstat (limited to 'dom/webgpu/tests/cts/checkout/src/webgpu/api/validation/query_set/destroy.spec.ts')
-rw-r--r-- | dom/webgpu/tests/cts/checkout/src/webgpu/api/validation/query_set/destroy.spec.ts | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/api/validation/query_set/destroy.spec.ts b/dom/webgpu/tests/cts/checkout/src/webgpu/api/validation/query_set/destroy.spec.ts new file mode 100644 index 0000000000..0a3c4fe241 --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/src/webgpu/api/validation/query_set/destroy.spec.ts @@ -0,0 +1,33 @@ +export const description = ` +Destroying a query set more than once is allowed. +`; + +import { makeTestGroup } from '../../../../common/framework/test_group.js'; +import { ValidationTest } from '../validation_test.js'; + +export const g = makeTestGroup(ValidationTest); + +g.test('twice').fn(t => { + const qset = t.device.createQuerySet({ type: 'occlusion', count: 1 }); + + qset.destroy(); + qset.destroy(); +}); + +g.test('invalid_queryset') + .desc('Test that invalid querysets may be destroyed without generating validation errors.') + .fn(async t => { + t.device.pushErrorScope('validation'); + + const invalidQuerySet = t.device.createQuerySet({ + type: 'occlusion', + count: 4097, // 4096 is the limit + }); + + // Expect error because it's invalid. + const error = await t.device.popErrorScope(); + t.expect(!!error); + + // This line should not generate an error + invalidQuerySet.destroy(); + }); |