Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  test_oom_annotation.js

  Sprache: JAVA
 

add_task(async function run_test() {
  if (!("@mozilla.org/toolkit/crash-reporter;1" in Cc)) {
    dump(
      "INFO | test_crash_oom.js | Can't test crashreporter in a non-libxul build.\n"
    );
    return;
  }

  await do_content_crash(
    function () {
      crashType = CrashTestUtils.CRASH_OOM;
      crashReporter.annotateCrashReport("TestKey""Yes");
    },
    function (mdump, extra) {
      const { AppConstants } = ChromeUtils.importESModule(
        "resource://gre/modules/AppConstants.sys.mjs"
      );
      Assert.equal(extra.TestKey, "Yes");

      // A list of pairs [annotation name, must be > 0]
      let annotations;
      switch (AppConstants.platform) {
        case "win":
          annotations = [
            ["OOMAllocationSize"true],
            ["SystemMemoryUsePercentage"false],
            ["TotalVirtualMemory"true],
            ["AvailableVirtualMemory"false],
            ["TotalPageFile"false],
            ["AvailablePageFile"false],
            ["TotalPhysicalMemory"true],
            ["AvailablePhysicalMemory"false],
          ];
          break;
        case "linux":
          annotations = [
            ["OOMAllocationSize"true],
            ["AvailablePageFile"false],
            ["AvailablePhysicalMemory"false],
            ["AvailableSwapMemory"false],
            ["AvailableVirtualMemory"false],
            ["TotalPageFile"false],
            ["TotalPhysicalMemory"true],
          ];
          break;
        case "macosx":
          annotations = [
            ["OOMAllocationSize"true],
            ["AvailablePhysicalMemory"false],
            ["AvailableSwapMemory"false],
            ["PurgeablePhysicalMemory"false],
            ["TotalPhysicalMemory"true],
          ];
          break;
        default:
          annotations = [];
      }
      for (let [label, shouldBeGreaterThanZero] of annotations) {
        Assert.ok(label in extra, `Annotation ${label} is present`);

        // All these annotations should represent non-negative numbers.
        // A few of them (e.g. physical memory) are guaranteed to be positive.
        if (shouldBeGreaterThanZero) {
          Assert.greater(Number(extra[label]), 0);
        } else {
          Assert.greaterOrEqual(Number(extra[label]), 0);
        }
      }
    }
  );
});

Messung V0.5 in Prozent
C=80 H=94 G=87

¤ Dauer der Verarbeitung: 0.15 Sekunden  (vorverarbeitet am  2026-08-26) ¤

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






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=655579