Bug 1935611 - Fix libyuv/libpng link failed for loongarch64. r=glandium,tnikkel,ng
[gecko.git] / dom / webgpu / mochitest / test_context_configure.html
blob66a91591f8e5c9cbcff01c3cb2a97cb2251fde51
1 <!doctype html>
2 <html>
3 <head>
4 <meta charset="utf-8" />
5 <script src="/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" href="/tests/SimpleTest/test.css" />
7 </head>
8 <body>
9 <script>
10 ok(
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;
25 let expectedError;
26 try {
27 context.configure({
28 device,
29 format,
30 });
31 } catch (error) {
32 expectedError = error;
34 // Bug 1864904: This should become an "is".
35 todo_is(
36 typeof expectedError,
37 "TypeError",
38 "Failed configure should generate a TypeError."
42 SimpleTest.waitForExplicitFinish();
43 testBody()
44 .catch(e => ok(false, "Unhandled exception " + e))
45 .finally(() => SimpleTest.finish());
46 </script>
47 </body>
48 </html>