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_cache2-25-chunk-memory-limit.js   Sprache: JAVA

 
"use strict";

function gen_200k() {
  var i;
  var data = "0123456789ABCDEFGHIJLKMNO";
  for (i = 0; i < 13; i++) {
    data += data;
  }
  return data;
}

// Keep the output stream of the first entry in a global variable, so the
// CacheFile and its buffer isn't released before we write the data to the
// second entry.
var oStr;

function run_test() {
  do_get_profile();

  // set max chunks memory so that only one full chunk fits within the limit
  Services.prefs.setIntPref("browser.cache.disk.max_chunks_memory_usage", 300);

  asyncOpenCacheEntry(
    "http://a/",
    "disk",
    Ci.nsICacheStorage.OPEN_NORMALLY,
    null,
    function (status, entry) {
      Assert.equal(status, Cr.NS_OK);
      var data = gen_200k();
      oStr = entry.openOutputStream(0, data.length);
      Assert.equal(data.length, oStr.write(data, data.length));

      asyncOpenCacheEntry(
        "http://b/",
        "disk",
        Ci.nsICacheStorage.OPEN_NORMALLY,
        null,
        function (status1, entry1) {
          Assert.equal(status1, Cr.NS_OK);
          var oStr2 = entry1.openOutputStream(0, data.length);
          do_check_throws_nsIException(
            () => oStr2.write(data, data.length),
            "NS_ERROR_OUT_OF_MEMORY"
          );
          finish_cache2_test();
        }
      );
    }
  );

  do_test_pending();
}

Messung V0.5
C=93 H=99 G=95

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

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