Skip to content

Commit

Permalink
Update tests for validating canvas texture formats in configure() (#3997
Browse files Browse the repository at this point in the history
)
  • Loading branch information
beaufortfrancois authored Oct 11, 2024
1 parent e331ae2 commit ab266c9
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/webgpu/web_platform/canvas/configure.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,21 @@ g.test('format')
}
}

t.expectValidationError(() => {
if (validFormat) {
ctx.configure({
device: t.device,
format,
});
}, !validFormat);

const configuration = ctx.getConfiguration();
t.expect(configuration!.format === format);

t.expectValidationError(() => {
// Should always return a texture, whether the configured format was valid or not.
const currentTexture = ctx.getCurrentTexture();
t.expect(currentTexture instanceof GPUTexture);
}, !validFormat);
const configuration = ctx.getConfiguration();
t.expect(configuration!.format === format);
} else {
t.shouldThrow('TypeError', () => {
ctx.configure({
device: t.device,
format,
});
});
}
});

g.test('usage')
Expand Down

0 comments on commit ab266c9

Please sign in to comment.