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

Quelle  test_debugger_client.js

  Sprache: JAVA
 

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


"use strict";

// DevToolsClient tests

const {
  DevToolsServer,
} = require("resource://devtools/server/devtools-server.js");
const {
  DevToolsClient,
} = require("resource://devtools/client/devtools-client.js");

add_task(async function () {
  await testCloseLoops();
  await fakeTransportShutdown();
});

function createClient() {
  DevToolsServer.init();
  DevToolsServer.registerAllActors();
  const client = new DevToolsClient(DevToolsServer.connectPipe());
  return client;
}

// Ensure that closing the client while it is closing doesn't loop
async function testCloseLoops() {
  const client = createClient();
  await client.connect();

  await new Promise(resolve => {
    let called = false;
    client.on("closed", async () => {
      dump(">> CLOSED\n");
      if (called) {
        ok(
          false,
          "Calling client.close from closed event listener introduce loops"
        );
        return;
      }
      called = true;
      await client.close();
      resolve();
    });
    client.close();
  });
}

// Check that, if we fake a transport shutdown (like if a device is unplugged)
// the client is automatically closed, and we can still call client.close.
async function fakeTransportShutdown() {
  const client = createClient();
  await client.connect();

  await new Promise(resolve => {
    const onClosed = async function () {
      client.off("closed", onClosed);
      ok(true"Client emitted 'closed' event");
      resolve();
    };
    client.on("closed", onClosed);
    client.transport.close();
  });

  await client.close();
  ok(true"client.close() successfully resolves");
}

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

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-05) ¤

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