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

Quelle  child_veto_in_parent.js

  Sprache: JAVA
 

/* import-globals-from ../unit/head_trr.js */

"use strict";

const { HttpServer } = ChromeUtils.importESModule(
  "resource://testing-common/httpd.sys.mjs"
);

ChromeUtils.defineLazyGetter(this"URL"function () {
  return "http://localhost:" + httpServer.identity.primaryPort;
});

var httpServer = null;
// Need to randomize, because apparently no one clears our cache
var randomPath = "/redirect/" + Math.random();

ChromeUtils.defineLazyGetter(this"randomURI"function () {
  return URL + randomPath;
});

function make_channel(url) {
  return NetUtil.newChannel({ uri: url, loadUsingSystemPrincipal: true });
}

const responseBody = "response body";

function redirectHandler(metadata, response) {
  response.setStatusLine(metadata.httpVersion, 301"Moved");
  response.setHeader("Location", URL + "/content"false);
}

function contentHandler(metadata, response) {
  response.setHeader("Content-Type""text/plain");
  response.bodyOutputStream.write(responseBody, responseBody.length);
}

add_task(async function doStuff() {
  httpServer = new HttpServer();
  httpServer.registerPathHandler(randomPath, redirectHandler);
  httpServer.registerPathHandler("/content", contentHandler);
  httpServer.start(-1);

  let chan = make_channel(randomURI);
  let [req, buff] = await new Promise(resolve =>
    chan.asyncOpen(
      new ChannelListener((aReq, aBuff) => resolve([aReq, aBuff]), null)
    )
  );
  Assert.equal(buff, "");
  Assert.equal(req.status, Cr.NS_OK);
  await httpServer.stop();
  await do_send_remote_message("child-test-done");
});

Messung V0.5 in Prozent
C=84 H=90 G=86

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