Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/webgpu/tests/mochitest/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 2 kB image not shown  

Quelle  test_context_configure.html

  Sprache: HTML
 

 products/Sources/formale Sprachen/C/Firefox/dom/webgpu/tests/mochitest/test_context_configure.html


<!doctype html>
<html>
  <head>
    <meta charset="utf-8" />
    <script src="/tests/SimpleTest/SimpleTest.js"></script>
    <link rel="stylesheet" href="/tests/SimpleTest/test.css" />
  </head>
  <body>
    <script>
      ok(
        SpecialPowers.getBoolPref("dom.webgpu.enabled"),
        "Pref should be enabled."
      );

      async function testBody() {
        const canvas = document.createElement("canvas");
        const context = canvas.getContext("webgpu");

        // The first two tests here are redundant with the CTS test
        // webgpu:web_platform,canvas,configure:device:*, but when
        // they were added, that CTS test had additional checks that
        // were still failing.
        let expectedError;
        try {
          context.configure({});
        } catch (error) {
          expectedError = error;
        }
        is(
          expectedError?.name,
          "TypeError",
          "Canvas configure without a device should generate a TypeError."
        );

        const adapter = await navigator.gpu.requestAdapter({});
        const device = await adapter.requestDevice({});
        const format = navigator.gpu.getPreferredCanvasFormat(adapter);

        expectedError = undefined;
        try {
          context.getCurrentTexture();
        } catch (error) {
          expectedError = error;
        }
        is(
          expectedError?.name,
          "InvalidStateError",
          "getCurrentTexture on unconfigured canvas should generate an InvalidStateError."
        );

        // Attempt to configure with a too-large canvas, which should
        // fail due to device texture limits.
        canvas.width = 1970696937;
        expectedError = undefined;
        try {
          context.configure({
            device,
            format,
          });
        } catch (error) {
          expectedError = error;
        }
        // Bug 1967833: This should become an "is". Or possibly it
        // should expect a validation error (asynchronously) instead.
        todo_is(
          expectedError?.name,
          "TypeError",
          "Failed configure should generate a TypeError."
        );
      }

      SimpleTest.waitForExplicitFinish();
      testBody()
        .catch(e => ok(false, "Unhandled exception " + e))
        .finally(() => SimpleTest.finish());
    </script>
  </body>
</html>

Messung V0.5 in Prozent
C=90 H=91 G=90

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.