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

Quelle  test_open_and_databases.js   Sprache: JAVA

 
/**
 * Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/
 */


/* exported testSteps */
async function testSteps() {
  const openInfos = [
    { name: "foo-a", version: 1 },
    { name: "foo-b", version: 1 },
  ];

  info("Creating databases");

  for (let index = 0; index < openInfos.length; index++) {
    const openInfo = openInfos[index];

    const request = indexedDB.open(openInfo.name, openInfo.version);

    await expectingUpgrade(request);

    const event = await expectingSuccess(request);

    const database = event.target.result;

    database.close();
  }

  info("Getting databases");

  const databasesPromise = indexedDB.databases();

  info("Opening databases");

  const openPromises = [];

  for (let index = 0; index < openInfos.length; index++) {
    const openInfo = openInfos[index];

    const request = indexedDB.open(openInfo.name, openInfo.version);

    const promise = expectingSuccess(request);

    openPromises.push(promise);
  }

  info("Waiting for databases operation to complete");

  const databaseInfos = await databasesPromise;

  info("Verifying databases");

  is(
    databaseInfos.length,
    openInfos.length,
    "The result of databases() should contain one result per database"
  );

  for (let index = 0; index < openInfos.length; index++) {
    const openInfo = openInfos[index];

    ok(
      databaseInfos.some(function (element) {
        return (
          element.name === openInfo.name && element.version === openInfo.version
        );
      }),
      "The result of databases() should be a sequence of the correct names " +
        "and versions of all databases for the origin"
    );
  }

  info("Waiting for open operations to complete");

  await Promise.all(openPromises);
}

Messung V0.5
C=91 H=94 G=92

¤ Dauer der Verarbeitung: 0.21 Sekunden  (vorverarbeitet)  ¤

*© 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.