4 <meta charset=
"utf-8" />
5 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel=
"stylesheet" href=
"/tests/SimpleTest/test.css" />
11 SpecialPowers
.getBoolPref("dom.webgpu.enabled"),
12 "Pref should be enabled."
15 async
function testBody() {
16 const adapter
= await navigator
.gpu
.requestAdapter({});
17 const device
= await adapter
.requestDevice({});
18 const canvas
= document
.createElement("canvas");
19 const context
= canvas
.getContext("webgpu");
20 const format
= navigator
.gpu
.getPreferredCanvasFormat(adapter
);
22 // Attempt to configure with a too-large canvas, which should
23 // fail due to device texture limits.
24 canvas
.width
= 1970696937;
32 expectedError
= error
;
34 // Bug 1864904: This should become an "is".
38 "Failed configure should generate a TypeError."
42 SimpleTest
.waitForExplicitFinish();
44 .catch(e
=> ok(false, "Unhandled exception " + e
))
45 .finally(() => SimpleTest
.finish());