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

Quelle  test_cookie_ipv6.js   Sprache: JAVA

 
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


/*
 *  Test that channels with different LoadInfo
 *  are stored in separate namespaces ("cookie jars")
 */


"use strict";

let ip = "[::1]";
ChromeUtils.defineLazyGetter(this"URL"function () {
  return `http://${ip}:${httpserver.identity.primaryPort}/`;
});

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

let httpserver = new HttpServer();

function cookieSetHandler(metadata, response) {
  response.setStatusLine(metadata.httpVersion, 200, "Ok");
  response.setHeader(
    "Set-Cookie",
    `Set-Cookie: T1=T2; path=/; SameSite=Lax; domain=${ip}; httponly`,
    false
  );
  response.setHeader("Content-Type""text/html");
  response.setHeader("Content-Length""2");
  response.bodyOutputStream.write("Ok""Ok".length);
}

add_task(async function test_cookie_ipv6() {
  Services.prefs.setIntPref("network.cookie.cookieBehavior", 0);
  Services.prefs.setBoolPref(
    "network.cookieJarSettings.unblocked_for_testing",
    true
  );

  httpserver.registerPathHandler("/", cookieSetHandler);
  httpserver._start(-1, ip);

  var chan = NetUtil.newChannel({
    uri: URL,
    loadUsingSystemPrincipal: true,
  });
  await new Promise(resolve => {
    chan.asyncOpen(new ChannelListener(resolve));
  });
  equal(Services.cookies.cookies.length, 1);
});

Messung V0.5
C=93 H=100 G=96

¤ Dauer der Verarbeitung: 0.22 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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.