Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/storage/test/chrome/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  test_failedOpenConnection_leak.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/storage/test/chrome/test_failedOpenConnection_leak.html


<!DOCTYPE HTML>
<html>

<head>
  <meta charset="utf-8">
  <title>Tests for the BackupSettings component</title>
  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
  <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
  <link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
  <script>

    const { Assert } = ChromeUtils.importESModule(
      "resource://testing-common/Assert.sys.mjs"
    );

    /**
     * Tests that failing to open a SQLite connection doesn't leak the SQLite
     * structure. sqlite3_close() must always be invoked, even in case of failures.
     * This will only fail on asan builds and requires shutdown leaks detection.
     */

    add_task(async function test_initWidget() {
      let file = Services.dirsvc.get("ProfDS", Ci.nsIFile);
      file.append("nonexisting.sqlite");

      try {
        file.remove(true);
      } catch (ex) { }
      await Assert.rejects(
        new Promise((resolve, reject) => {
          Services.storage.openAsyncDatabase(
            file,
            Ci.mozIStorageService.OPEN_READONLY,
            Ci.mozIStorageService.CONNECTION_DEFAULT,
            function (status, db) {
              if (Components.isSuccessCode(status)) {
                resolve(db.QueryInterface(Ci.mozIStorageAsyncConnection));
              } else {
                reject(new Components.Exception("Error opening database", status));
              }
            }
          );
        }),
        /NS_ERROR_FILE_ACCESS_DENIED/,
        "Should fail to open non existing database"
      );
    });

    ok(true, "Must have at least one test");

  </script>
</head>

<body>
  <p id="display"></p>
  <div id="content" style="display: none">
  </div>
  <pre id="test"></pre>
</body>

</html>

Messung V0.5
C=100 H=100 G=100

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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.