Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/netwerk/cookie/test/unit/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 776 B image not shown  

Quelle  test_maybeCapExpiry.js

  Sprache: JAVA
 

"use strict";

add_task(function test_maybeCapExpiry() {
  const CAP_PREF = "network.cookie.maxageCap";
  Services.prefs.setIntPref(CAP_PREF, 10); // 10 seconds cap

  let now = Date.now();
  let expiry = now + 60 * 1000// 60 seconds in future
  let capped = Services.cookies.maybeCapExpiry(expiry);

  Assert.lessOrEqual(
    capped,
    now + 20 * 1000,
    "expiry should be capped to about now + cap"
  );
  Assert.lessOrEqual(
    capped,
    expiry,
    "result should not exceed original expiry"
  );

  // Expiry below cap should be returned unchanged
  let smallExpiry = now + 1000// 1 seconds
  let res = Services.cookies.maybeCapExpiry(smallExpiry);
  Assert.equal(res, smallExpiry, "expiry below cap unchanged");

  Services.prefs.clearUserPref(CAP_PREF);
});

Messung V0.5 in Prozent
C=86 H=100 G=93

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

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