From cc0a3721275398a5b081ba5ee8e13fa2410ada04 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Sat, 27 Jan 2024 23:10:09 +0530 Subject: feat(unstable): implement `navigator.gpu.getPreferredCanvasFormat()` (#22149) --- cli/tests/unit/webgpu_test.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cli/tests/unit') diff --git a/cli/tests/unit/webgpu_test.ts b/cli/tests/unit/webgpu_test.ts index bcdc6b1ff..75ae34981 100644 --- a/cli/tests/unit/webgpu_test.ts +++ b/cli/tests/unit/webgpu_test.ts @@ -247,6 +247,11 @@ Deno.test({ Deno.close(Number(resources[resources.length - 1])); }); +Deno.test(function getPreferredCanvasFormat() { + const preferredFormat = navigator.gpu.getPreferredCanvasFormat(); + assert(preferredFormat === "bgra8unorm" || preferredFormat === "rgba8unorm"); +}); + async function checkIsWsl() { return Deno.build.os === "linux" && await hasMicrosoftProcVersion(); -- cgit v1.2.3