Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/services/sync/tests/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_addons_validator.js   Sprache: JAVA

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


const { AddonValidator } = ChromeUtils.importESModule(
  "resource://services-sync/engines/addons.sys.mjs"
);

function getDummyServerAndClient() {
  return {
    server: [
      {
        id: "1111",
        applicationID: Services.appinfo.ID,
        addonID: "synced-addon@example.com",
        enabled: true,
        source: "amo",
        understood: true,
      },
    ],
    client: [
      {
        syncGUID: "1111",
        id: "synced-addon@example.com",
        type: "extension",
        isSystem: false,
        isSyncable: true,
      },
      {
        syncGUID: "2222",
        id: "system-addon@example.com",
        type: "extension",
        isSystem: true,
        isSyncable: false,
      },
      {
        // Plugins don't have a `syncedGUID`, but we don't sync them, so we
        // shouldn't report them as client duplicates.
        id: "some-plugin",
        type: "plugin",
      },
      {
        id: "another-plugin",
        type: "plugin",
      },
    ],
  };
}

add_task(async function test_valid() {
  let { server, client } = getDummyServerAndClient();
  let validator = new AddonValidator({
    _findDupe() {
      return null;
    },
    isAddonSyncable(item) {
      return item.type != "plugin";
    },
  });
  let { problemData, clientRecords, records, deletedRecords } =
    await validator.compareClientWithServer(client, server);
  equal(clientRecords.length, 4);
  equal(records.length, 1);
  equal(deletedRecords.length, 0);
  deepEqual(problemData, validator.emptyProblemData());
});

Messung V0.5
C=95 H=98 G=96

¤ Dauer der Verarbeitung: 0.1 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.