summaryrefslogtreecommitdiff
path: root/tests/unit/webgpu_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/webgpu_test.ts')
-rw-r--r--tests/unit/webgpu_test.ts21
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/unit/webgpu_test.ts b/tests/unit/webgpu_test.ts
index ae584a587..6c91abe4a 100644
--- a/tests/unit/webgpu_test.ts
+++ b/tests/unit/webgpu_test.ts
@@ -236,13 +236,32 @@ Deno.test({
assertThrows(
() => {
- new Deno.UnsafeWindowSurface("cocoa", null, null);
+ new Deno.UnsafeWindowSurface({
+ system: "cocoa",
+ windowHandle: null,
+ displayHandle: null,
+ width: 0,
+ height: 0,
+ });
},
);
device.destroy();
});
+Deno.test(function webgpuWindowSurfaceNoWidthHeight() {
+ assertThrows(
+ () => {
+ // @ts-expect-error width and height are required
+ new Deno.UnsafeWindowSurface({
+ system: "x11",
+ windowHandle: null,
+ displayHandle: null,
+ });
+ },
+ );
+});
+
Deno.test(function getPreferredCanvasFormat() {
const preferredFormat = navigator.gpu.getPreferredCanvasFormat();
assert(preferredFormat === "bgra8unorm" || preferredFormat === "rgba8unorm");