Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/xpconnect/tests/unit/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  test_scriptable_nsIClassInfo.js

  Sprache: JAVA
 

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


add_task(function () {
  class TestClass {
    QueryInterface = ChromeUtils.generateQI([
      "nsIXPCTestInterfaceA",
      "nsIClassInfo",
    ]);

    interfaces = [Ci.nsIXPCTestInterfaceA, Ci.nsIClassInfo, Ci.nsISupports];
    contractID = "@mozilla.org/test/class;1";
    classDescription = "description";
    classID = Components.ID("{4da556d4-00fa-451a-a280-d2aec7c5f265}");
    flags = 0;

    name = "this is a test";
  }

  let instance = new TestClass();
  Assert.ok(instance, "can create an instance");
  Assert.ok(instance.QueryInterface(Ci.nsIClassInfo), "can QI to nsIClassInfo");

  let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
  registrar.registerFactory(
    instance.classID,
    instance.classDescription,
    instance.contractID,
    {
      createInstance(iid) {
        return instance.QueryInterface(iid);
      },
    }
  );
  Assert.ok(true"successfully registered the factory");

  let otherInstance = Cc["@mozilla.org/test/class;1"].createInstance(
    Ci.nsIXPCTestInterfaceA
  );
  Assert.ok(otherInstance, "can create an instance via xpcom");
});

Messung V0.5 in Prozent
C=94 H=94 G=93

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-06-10) ¤

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