Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/ipc/tests/JSWindowActor/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 3 kB image not shown  

Quelle  browser_crash_report.js

  Sprache: JAVA
 

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

"use strict";

declTest("crash actor", {
  allFrames: true,

  async test() {
    if (!("@mozilla.org/toolkit/crash-reporter;1" in Cc)) {
      ok(true"Cannot test crash annotations without a crash reporter");
      return;
    }

    {
      info("Creating a new tab.");
      let newTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, URL);
      let newTabBrowser = newTab.linkedBrowser;

      let parent =
        newTabBrowser.browsingContext.currentWindowGlobal.getActor(
          "TestWindow"
        );
      ok(parent, "JSWindowActorParent should have value.");

      await SpecialPowers.spawn(newTabBrowser, [], async function () {
        let child = content.windowGlobalChild;
        ok(child, "WindowGlobalChild should have value.");
        is(
          child.isInProcess,
          false,
          "Actor should be loaded in the content process."
        );
        // Make sure that the actor is loaded.
        let actorChild = child.getActor("TestWindow");
        is(
          actorChild.show(),
          "TestWindowChild",
          "actor show should have value."
        );
        is(
          actorChild.manager,
          child,
          "manager should match WindowGlobalChild."
        );
      });

      info(
        "Crashing from withing an actor. We should have an actor name and a message name."
      );
      let report = await BrowserTestUtils.crashFrame(
        newTabBrowser,
        /* shouldShowTabCrashPage = */ false,
        /* shouldClearMinidumps =  */ true,
        /* browsingContext = */ null,
        { asyncCrash: false }
      );

      is(report.JSActorName, "BrowserTestUtils");
      is(report.JSActorMessage, "BrowserTestUtils:CrashFrame");

      BrowserTestUtils.removeTab(newTab);
    }

    {
      info("Creating a new tab for async crash");
      let newTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, URL);
      let newTabBrowser = newTab.linkedBrowser;

      let parent =
        newTabBrowser.browsingContext.currentWindowGlobal.getActor(
          "TestWindow"
        );
      ok(parent, "JSWindowActorParent should have value.");

      await SpecialPowers.spawn(newTabBrowser, [], async function () {
        let child = content.windowGlobalChild;
        ok(child, "WindowGlobalChild should have value.");
        is(
          child.isInProcess,
          false,
          "Actor should be loaded in the content process."
        );
        // Make sure that the actor is loaded.
        let actorChild = child.getActor("TestWindow");
        is(
          actorChild.show(),
          "TestWindowChild",
          "actor show should have value."
        );
        is(
          actorChild.manager,
          child,
          "manager should match WindowGlobalChild."
        );
      });

      info(
        "Crashing from without an actor. We should have neither an actor name nor a message name."
      );
      let report = await BrowserTestUtils.crashFrame(
        newTabBrowser,
        /* shouldShowTabCrashPage = */ false,
        /* shouldClearMinidumps =  */ true,
        /* browsingContext = */ null,
        { asyncCrash: true }
      );

      ok(!report.JSActorName);
      ok(!report.JSActorMessage);

      BrowserTestUtils.removeTab(newTab);
    }
  },
});

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

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